diff options
Diffstat (limited to 'compiler/GHC/Tc')
-rw-r--r-- | compiler/GHC/Tc/Errors/Ppr.hs | 24 | ||||
-rw-r--r-- | compiler/GHC/Tc/Errors/Types.hs | 16 |
2 files changed, 20 insertions, 20 deletions
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs index 3ab4fc2927..35bfea6ae1 100644 --- a/compiler/GHC/Tc/Errors/Ppr.hs +++ b/compiler/GHC/Tc/Errors/Ppr.hs @@ -946,17 +946,17 @@ instance Diagnostic TcRnMessage where text "Cannot redefine a Name retrieved by a Template Haskell quote:" <+> ppr name TcRnIllegalBindingOfBuiltIn name -> mkSimpleDecorated $ text "Illegal binding of built-in syntax:" <+> ppr name - TcRnDeprecated {depr_occ, depr_msg, depr_import_mod, depr_defined_mod} -> mkSimpleDecorated $ - sep [ sep [ text "In the use of" - <+> pprNonVarNameSpace (occNameSpace depr_occ) - <+> quotes (ppr depr_occ) + TcRnPragmaWarning {pragma_warning_occ, pragma_warning_msg, pragma_warning_import_mod, pragma_warning_defined_mod} + -> mkSimpleDecorated $ + sep [ sep [ text "In the use of" + <+> pprNonVarNameSpace (occNameSpace pragma_warning_occ) + <+> quotes (ppr pragma_warning_occ) , parens impMsg <> colon ] - , pprWarningTxtForMsg depr_msg ] - where - impMsg = text "imported from" <+> ppr depr_import_mod <> extra - extra | depr_import_mod == depr_defined_mod = empty - | otherwise = text ", but defined in" <+> ppr depr_defined_mod - + , pprWarningTxtForMsg pragma_warning_msg ] + where + impMsg = text "imported from" <+> ppr pragma_warning_import_mod <> extra + extra | pragma_warning_import_mod == pragma_warning_defined_mod = empty + | otherwise = text ", but defined in" <+> ppr pragma_warning_defined_mod diagnosticReason = \case TcRnUnknownMessage m -> diagnosticReason m @@ -1268,7 +1268,7 @@ instance Diagnostic TcRnMessage where -> ErrorWithoutFlag TcRnIllegalBindingOfBuiltIn{} -> ErrorWithoutFlag - TcRnDeprecated{} + TcRnPragmaWarning{} -> WarningWithFlag Opt_WarnWarningsDeprecations diagnosticHints = \case @@ -1582,7 +1582,7 @@ instance Diagnostic TcRnMessage where -> [SuggestSpecialiseVisibilityHints name] TcRnNameByTemplateHaskellQuote{} -> noHints TcRnIllegalBindingOfBuiltIn{} -> noHints - TcRnDeprecated{} -> noHints + TcRnPragmaWarning{} -> noHints -- | Change [x] to "x", [x, y] to "x and y", [x, y, z] to "x, y, and z", diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index fff6ff7dc9..62732ed8dd 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -2158,22 +2158,22 @@ data TcRnMessage where -} TcRnIllegalBindingOfBuiltIn :: !OccName -> TcRnMessage - {- TcRnDeprecated is a warning that can happen when usage of something - is deprecated. + {- TcRnPragmaWarning is a warning that can happen when usage of something + is warned or deprecated by pragma. Test cases: DeprU T5281 T5867 rn050 - rn066 + rn066 (here is a warning, not deprecation) T3303 -} - TcRnDeprecated :: { - depr_occ :: OccName, - depr_msg :: WarningTxt GhcRn, - depr_import_mod :: ModuleName, - depr_defined_mod :: ModuleName + TcRnPragmaWarning :: { + pragma_warning_occ :: OccName, + pragma_warning_msg :: WarningTxt GhcRn, + pragma_warning_import_mod :: ModuleName, + pragma_warning_defined_mod :: ModuleName } -> TcRnMessage -- | Specifies which back ends can handle a requested foreign import or export |