Commit 161e08c5 authored by Krzysztof Gogolewski's avatar Krzysztof Gogolewski Committed by Marge Bot

Remove dead code

* FailablePattern can no longer be created since ab51bee4
  Therefore, Opt_WarnMissingMonadFailInstances has no effect anymore.
* XWrap is no longer used, it was moved to an extension field
parent 09b88384
Pipeline #16254 passed with stages
in 599 minutes and 19 seconds
......@@ -875,7 +875,7 @@ data WarningFlag =
| Opt_WarnRedundantRecordWildcards
| Opt_WarnWarningsDeprecations
| Opt_WarnDeprecatedFlags
| Opt_WarnMissingMonadFailInstances -- since 8.0
| Opt_WarnMissingMonadFailInstances -- since 8.0, has no effect since 8.8
| Opt_WarnSemigroup -- since 8.0
| Opt_WarnDodgyExports
| Opt_WarnDodgyImports
......@@ -4918,8 +4918,7 @@ minusWeverythingOpts = [ toEnum 0 .. ]
-- code future compatible to fix issues before they even generate warnings.
minusWcompatOpts :: [WarningFlag]
minusWcompatOpts
= [ Opt_WarnMissingMonadFailInstances
, Opt_WarnSemigroup
= [ Opt_WarnSemigroup
, Opt_WarnNonCanonicalMonoidInstances
, Opt_WarnStarIsType
, Opt_WarnCompatUnqualifiedImports
......
......@@ -666,8 +666,6 @@ type instance XBinTick (GhcPass _) = NoExtField
type instance XPragE (GhcPass _) = NoExtField
type instance XWrap (GhcPass _) = NoExtField
type instance XXExpr GhcPs = NoExtCon
type instance XXExpr GhcRn = NoExtCon
type instance XXExpr GhcTc = HsWrap HsExpr
......
......@@ -522,7 +522,6 @@ type family XStatic x
type family XTick x
type family XBinTick x
type family XPragE x
type family XWrap x
type family XXExpr x
type family XSCC x
......
......@@ -810,31 +810,20 @@ cmp_loc ct1 ct2 = ctLocSpan (ctLoc ct1) `compare` ctLocSpan (ctLoc ct2)
reportGroup :: (ReportErrCtxt -> [Ct] -> TcM ErrMsg) -> ReportErrCtxt
-> [Ct] -> TcM ()
reportGroup mk_err ctxt cts =
case partition isMonadFailInstanceMissing cts of
-- Only warn about missing MonadFail constraint when
-- there are no other missing constraints!
(monadFailCts, []) ->
do { err <- mk_err ctxt monadFailCts
; reportWarning (Reason Opt_WarnMissingMonadFailInstances) err }
(_, cts') -> do { err <- mk_err ctxt cts'
; traceTc "About to maybeReportErr" $
vcat [ text "Constraint:" <+> ppr cts'
, text "cec_suppress =" <+> ppr (cec_suppress ctxt)
, text "cec_defer_type_errors =" <+> ppr (cec_defer_type_errors ctxt) ]
; maybeReportError ctxt err
-- But see Note [Always warn with -fdefer-type-errors]
; traceTc "reportGroup" (ppr cts')
; mapM_ (addDeferredBinding ctxt err) cts' }
-- Add deferred bindings for all
-- Redundant if we are going to abort compilation,
-- but that's hard to know for sure, and if we don't
-- abort, we need bindings for all (e.g. #12156)
where
isMonadFailInstanceMissing ct =
case ctLocOrigin (ctLoc ct) of
FailablePattern _pat -> True
_otherwise -> False
ASSERT( not (null cts))
do { err <- mk_err ctxt cts
; traceTc "About to maybeReportErr" $
vcat [ text "Constraint:" <+> ppr cts
, text "cec_suppress =" <+> ppr (cec_suppress ctxt)
, text "cec_defer_type_errors =" <+> ppr (cec_defer_type_errors ctxt) ]
; maybeReportError ctxt err
-- But see Note [Always warn with -fdefer-type-errors]
; traceTc "reportGroup" (ppr cts)
; mapM_ (addDeferredBinding ctxt err) cts }
-- Add deferred bindings for all
-- Redundant if we are going to abort compilation,
-- but that's hard to know for sure, and if we don't
-- abort, we need bindings for all (e.g. #12156)
maybeReportHoleError :: ReportErrCtxt -> Ct -> ErrMsg -> TcM ()
-- Unlike maybeReportError, these "hole" errors are
......
......@@ -437,10 +437,6 @@ data CtOrigin
| ListOrigin -- An overloaded list
| BracketOrigin -- An overloaded quotation bracket
| StaticOrigin -- A static form
| FailablePattern (LPat GhcTcId) -- A failable pattern in do-notation for the
-- MonadFail Proposal (MFP). Obsolete when
-- actual desugaring to MonadFail.fail is
-- live.
| Shouldn'tHappenOrigin String
-- the user should never see this one,
-- unless ImpredicativeTypes is on, where all
......@@ -601,10 +597,6 @@ pprCtOrigin (MCompPatOrigin pat)
= ctoHerald <+> hsep [ text "the failable pattern"
, quotes (ppr pat)
, text "in a statement in a monad comprehension" ]
pprCtOrigin (FailablePattern pat)
= ctoHerald <+> text "the failable pattern" <+> quotes (ppr pat)
$$
text "(this will become an error in a future GHC release)"
pprCtOrigin (Shouldn'tHappenOrigin note)
= sdocOption sdocImpredicativeTypes $ \case
......
......@@ -13,7 +13,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......@@ -37,7 +36,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......@@ -60,7 +58,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......@@ -85,7 +82,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......
......@@ -14,7 +14,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......
......@@ -13,7 +13,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......@@ -37,7 +36,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......@@ -60,7 +58,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......@@ -85,7 +82,6 @@ other dynamic, non-language, flag settings:
-fimplicit-import-qualified
-fshow-warning-groups
warning settings:
-Wmissing-monadfail-instances
-Wsemigroup
-Wnoncanonical-monoid-instances
-Wstar-is-type
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment