From: simonpj Date: Thu, 7 Dec 2000 10:06:20 +0000 (+0000) Subject: [project @ 2000-12-07 10:06:20 by simonpj] X-Git-Tag: Approximately_9120_patches~3176 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=16d403da35bf16ee7f54e1a5ec0e86513d757126;p=ghc-hetmet.git [project @ 2000-12-07 10:06:20 by simonpj] Dont warn about uses of deprecated things in its own module --- diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 8dbd8a2..7a3ae9a 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -772,22 +772,26 @@ warnDeprecations this_mod export_avails my_deprecs used_names pit = iPIT ifaces deprecs = [ (n,txt) | n <- nameSetToList used_names, + not (nameIsLocalOrFrom this_mod n), Just txt <- [lookup_deprec hit pit n] ] + -- nameIsLocalOrFrom: don't complain about locally defined names + -- For a start, we may be exporting a deprecated thing + -- Also we may use a deprecated thing in the defn of another + -- deprecated things. We may even use a deprecated thing in + -- the defn of a non-deprecated thing, when changing a module's + -- interface in mapRn_ warnDeprec deprecs where - export_mods = nub [ moduleName (nameModule name) + export_mods = nub [ moduleName mod | avail <- export_avails, - let name = availName avail, - not (nameIsLocalOrFrom this_mod name) ] + let mod = nameModule (availName avail), + mod /= this_mod ] load_home m = loadInterface (text "Check deprecations for" <+> ppr m) m ImportBySystem lookup_deprec hit pit n - | nameIsLocalOrFrom this_mod n - = lookupDeprec my_deprecs n - | otherwise = case lookupIface hit pit n of Just iface -> lookupDeprec (mi_deprecs iface) n Nothing -> pprPanic "warnDeprecations:" (ppr n)