diff options
-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 |