diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-11-19 11:26:17 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-25 01:03:17 -0500 |
commit | 6907e9fae4bda5807872073fa98667db327ad0bb (patch) | |
tree | 369d538ea471c5ef7108f9369b28bb7a3b84c71e /compiler | |
parent | f0c5d8d33b669b80cbf715867d30793b0ee7a888 (diff) | |
download | haskell-6907e9fae4bda5807872073fa98667db327ad0bb.tar.gz |
Revert "Convert lookupIdSubst panic back to a warning (#20200)"
This reverts commit df1d808f26544cbb77d85773d672137c65fd3cc7.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Core/Subst.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index 83e91ad21a..5a6beca0f7 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -61,7 +61,6 @@ import GHC.Types.Unique.Supply import GHC.Builtin.Names import GHC.Data.Maybe -import GHC.Utils.Trace import GHC.Utils.Misc import GHC.Utils.Outputable import GHC.Utils.Panic @@ -251,15 +250,14 @@ extendSubstList subst ((var,rhs):prs) = extendSubstList (extendSubst subst var r -- | Find the substitution for an 'Id' in the 'Subst' lookupIdSubst :: HasDebugCallStack => Subst -> Id -> CoreExpr -lookupIdSubst s@(Subst in_scope ids _ _) v +lookupIdSubst (Subst in_scope ids _ _) v | not (isLocalId v) = Var v | Just e <- lookupVarEnv ids v = e | Just v' <- lookupInScope in_scope v = Var v' -- Vital! See Note [Extending the Subst] - -- See #20200 - | otherwise = warnPprTrace True (text "GHC.Core.Subst.lookupIdSubst" <+> ppr v - $$ ppr s) $ - Var v + -- If v isn't in the InScopeSet, we panic, because + -- it's a bad bug and we reallly want to know + | otherwise = pprPanic "lookupIdSubst" (ppr v $$ ppr in_scope) delBndr :: Subst -> Var -> Subst delBndr (Subst in_scope ids tvs cvs) v |