From: panne Date: Thu, 2 Mar 2000 14:20:28 +0000 (+0000) Subject: [project @ 2000-03-02 14:20:28 by panne] X-Git-Tag: Approximately_9120_patches~5067 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=61910d306d2bf9dfabc1e1e751485af73ef1250c;p=ghc-hetmet.git [project @ 2000-03-02 14:20:28 by panne] Deprecation warnings have a useful source location now. --- diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 986a19c..bc6cfa1 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -542,18 +542,17 @@ reportUnusedNames gbl_env avail_env (ExportEnv export_avails _ _) mentioned_name bad_locals = [n | n <- defined_but_not_used, isLocallyDefined n] bad_imps = [n | n <- defined_but_not_used, isUserImportedExplicitlyName n] - non_locally_used = [ n | n <- nameSetToList really_used_names, not (isLocallyDefined n) ] - deprec_used deprec_env = [ (n,txt) | n <- non_locally_used, Just txt <- [lookupNameEnv deprec_env n] ] + deprec_used deprec_env = [ (n,txt) + | n <- nameSetToList mentioned_names, + not (isLocallyDefined n), + Just txt <- [lookupNameEnv deprec_env n] ] in - traceRn (text "really used and non-locally defined" <> colon <+> - nest 4 (fsep (punctuate comma [ text (occNameFlavour (nameOccName n)) <+> ppr n - | n <- non_locally_used]))) `thenRn_` - getIfacesRn `thenRn` \ ifaces -> + warnUnusedLocalBinds bad_locals `thenRn_` + warnUnusedImports bad_imps `thenRn_` + getIfacesRn `thenRn` \ ifaces -> (if opt_WarnDeprecations then mapRn_ warnDeprec (deprec_used (iDeprecs ifaces)) - else returnRn ()) `thenRn_` - warnUnusedLocalBinds bad_locals `thenRn_` - warnUnusedImports bad_imps + else returnRn ()) warnDeprec :: (Name, DeprecTxt) -> RnM d () warnDeprec (name, txt)