diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-02-24 16:28:26 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-02-26 15:09:30 -0500 |
commit | 161e08c5d85d7ee7f731db31481cd818480f07a7 (patch) | |
tree | 16806b73afba5309ced28b759d66a6d09854a4f4 | |
parent | 09b8838422d5dde32af7b09c8adcb4dff4cd00fb (diff) | |
download | haskell-161e08c5d85d7ee7f731db31481cd818480f07a7.tar.gz |
Remove dead code
* FailablePattern can no longer be created since ab51bee40c82
Therefore, Opt_WarnMissingMonadFailInstances has no effect anymore.
* XWrap is no longer used, it was moved to an extension field
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 5 | ||||
-rw-r--r-- | compiler/GHC/Hs/Expr.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/Hs/Extension.hs | 1 | ||||
-rw-r--r-- | compiler/typecheck/TcErrors.hs | 39 | ||||
-rw-r--r-- | compiler/typecheck/TcOrigin.hs | 8 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9293.stdout | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci024.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci057.stdout | 4 |
8 files changed, 16 insertions, 48 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 4eb9ab2597..f20a899086 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -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 diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index a84bc1b240..f6f0541097 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -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 diff --git a/compiler/GHC/Hs/Extension.hs b/compiler/GHC/Hs/Extension.hs index cde29509c5..31e6a20f5d 100644 --- a/compiler/GHC/Hs/Extension.hs +++ b/compiler/GHC/Hs/Extension.hs @@ -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 diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index de38cdfcec..d098edac8a 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -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 diff --git a/compiler/typecheck/TcOrigin.hs b/compiler/typecheck/TcOrigin.hs index c69013917c..4137939135 100644 --- a/compiler/typecheck/TcOrigin.hs +++ b/compiler/typecheck/TcOrigin.hs @@ -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 diff --git a/testsuite/tests/ghci/scripts/T9293.stdout b/testsuite/tests/ghci/scripts/T9293.stdout index 57820fc4ed..12f5958925 100644 --- a/testsuite/tests/ghci/scripts/T9293.stdout +++ b/testsuite/tests/ghci/scripts/T9293.stdout @@ -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 diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout b/testsuite/tests/ghci/scripts/ghci024.stdout index e4e664ada9..c2efd4e68f 100644 --- a/testsuite/tests/ghci/scripts/ghci024.stdout +++ b/testsuite/tests/ghci/scripts/ghci024.stdout @@ -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 diff --git a/testsuite/tests/ghci/scripts/ghci057.stdout b/testsuite/tests/ghci/scripts/ghci057.stdout index 57820fc4ed..12f5958925 100644 --- a/testsuite/tests/ghci/scripts/ghci057.stdout +++ b/testsuite/tests/ghci/scripts/ghci057.stdout @@ -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 |