Commit d3d3c612 authored by qrczak's avatar qrczak
Browse files

[project @ 2000-08-18 06:34:26 by qrczak]

Unused Prelude import check moved to a better place.
parent ff833e2f
......@@ -765,7 +765,8 @@ reportUnusedNames mod_name direct_import_mods
-- unused_imp_mods are the directly-imported modules
-- that are not mentioned in minimal_imports
unused_imp_mods = [m | m <- direct_import_mods,
not (maybeToBool (lookupFM minimal_imports m))]
not (maybeToBool (lookupFM minimal_imports m)),
moduleName m /= pRELUDE_Name]
module_unused :: Name -> Bool
-- Name is imported from a module that's completely unused,
......
......@@ -36,7 +36,6 @@ import OccName ( OccName,
import TysWiredIn ( listTyCon )
import Type ( funTyCon )
import Module ( ModuleName, mkThisModule, moduleName, mkVanillaModule, pprModuleName )
import PrelInfo ( pRELUDE_Name )
import FiniteMap
import UniqSupply
import SrcLoc ( SrcLoc, noSrcLoc )
......@@ -709,8 +708,7 @@ mapFvRn f xs = mapRn f xs `thenRn` \ stuff ->
warnUnusedModules :: [Module] -> RnM d ()
warnUnusedModules mods
| not opt_WarnUnusedImports = returnRn ()
| otherwise = mapRn_ (addWarnRn . unused_mod) $
filter (/= pRELUDE_Name) (map moduleName mods)
| otherwise = mapRn_ (addWarnRn . unused_mod . moduleName) mods
where
unused_mod m = vcat [ptext SLIT("Module") <+> quotes (pprModuleName m) <+>
text "is imported, but nothing from it is used",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment