X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRename.lhs;h=7a3ae9a3d14301889943ab0a9b4afd9c724ca1bb;hb=16d403da35bf16ee7f54e1a5ec0e86513d757126;hp=8dbd8a2ed5b0d22a8f1650404038e6cbee3ff102;hpb=0b62f53e6da34769aa1bf8409d9987a5311bb516;p=ghc-hetmet.git 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)