From: qrczak Date: Fri, 18 Aug 2000 06:03:26 +0000 (+0000) Subject: [project @ 2000-08-18 06:03:26 by qrczak] X-Git-Tag: Approximately_9120_patches~3865 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ff833e2f75ff8ecef449ebe9dd9854b443a52e1a;p=ghc-hetmet.git [project @ 2000-08-18 06:03:26 by qrczak] Never say: "Warning: Module `Prelude' is imported, but nothing from it is used" --- diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index 4a8b0d3..7bd4302 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -36,6 +36,7 @@ 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 ) @@ -708,7 +709,8 @@ mapFvRn f xs = mapRn f xs `thenRn` \ stuff -> warnUnusedModules :: [Module] -> RnM d () warnUnusedModules mods | not opt_WarnUnusedImports = returnRn () - | otherwise = mapRn_ (addWarnRn . unused_mod . moduleName) mods + | otherwise = mapRn_ (addWarnRn . unused_mod) $ + filter (/= pRELUDE_Name) (map moduleName mods) where unused_mod m = vcat [ptext SLIT("Module") <+> quotes (pprModuleName m) <+> text "is imported, but nothing from it is used",