From f9f5235fce1fb043b0738d86190a4e50386e5dcc Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 27 Oct 2005 15:21:05 +0000 Subject: [PATCH] [project @ 2005-10-27 15:21:05 by simonpj] Improve warning a little (suggested by Benjamin Pierce) --- ghc/compiler/rename/RnEnv.lhs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index 1e464a1..99d6a34 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -709,10 +709,13 @@ warnUnusedModules mods = ifOptM Opt_WarnUnusedImports (mappM_ bleat mods) where bleat (mod,loc) = setSrcSpan loc $ addWarn (mk_warn mod) - mk_warn m = vcat [ptext SLIT("Module") <+> quotes (ppr m) <+> - text "is imported, but nothing from it is used", - parens (ptext SLIT("except perhaps instances visible in") <+> - quotes (ppr m))] + mk_warn m = vcat [ptext SLIT("Module") <+> quotes (ppr m) + <+> text "is imported, but nothing from it is used,", + nest 2 (ptext SLIT("except perhaps instances visible in") + <+> quotes (ppr m)), + ptext SLIT("To suppress this warning, use:") + <+> ptext SLIT("import") <+> ppr m <> parens empty ] + warnUnusedImports, warnUnusedTopBinds :: [GlobalRdrElt] -> RnM () warnUnusedImports gres = ifOptM Opt_WarnUnusedImports (warnUnusedGREs gres) -- 1.7.10.4