[project @ 2000-08-18 06:34:26 by qrczak]
authorqrczak <unknown>
Fri, 18 Aug 2000 06:34:26 +0000 (06:34 +0000)
committerqrczak <unknown>
Fri, 18 Aug 2000 06:34:26 +0000 (06:34 +0000)
Unused Prelude import check moved to a better place.

ghc/compiler/rename/Rename.lhs
ghc/compiler/rename/RnEnv.lhs

index 68ac301..df72d31 100644 (file)
@@ -764,8 +764,9 @@ 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))]
+       unused_imp_mods = [m | m <- direct_import_mods,
+                              not (maybeToBool (lookupFM minimal_imports m)),
+                              moduleName m /= pRELUDE_Name]
 
        module_unused :: Name -> Bool
        -- Name is imported from a module that's completely unused,
index 7bd4302..4a8b0d3 100644 (file)
@@ -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",