diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-11-19 11:26:17 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2021-11-22 12:47:58 +0000 |
commit | db8f077d5cc44bf83c20284461a189e83be1e886 (patch) | |
tree | a5a4f81677d218adfe85efbcf840e83f462fcc80 | |
parent | f30336e22bc888803087f19fbcb7f790260b9c4c (diff) | |
download | haskell-wip/t20561.tar.gz |
Revert "Convert lookupIdSubst panic back to a warning (#20200)"wip/t20561
This reverts commit df1d808f26544cbb77d85773d672137c65fd3cc7.
-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 |