From f3892b5f57b5a75c20eb12a45575a15b2a3dfd3f Mon Sep 17 00:00:00 2001 From: Krzysztof Gogolewski Date: Thu, 19 Aug 2021 16:48:49 +0200 Subject: Convert lookupIdSubst panic back to a warning (#20200) --- compiler/GHC/Core/Subst.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/GHC/Core/Subst.hs') diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index ddb8e71f1f..1544e5b192 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -61,6 +61,7 @@ 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 @@ -255,9 +256,10 @@ lookupIdSubst (Subst in_scope ids _ _) v | Just e <- lookupVarEnv ids v = e | Just v' <- lookupInScope in_scope v = Var v' -- Vital! See Note [Extending the Subst] - -- 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) + -- See #20200 + | otherwise = warnPprTrace True (text "GHC.Core.Subst.lookupIdSubst" <+> ppr v + $$ ppr in_scope) $ + Var v -- | Find the substitution for a 'TyVar' in the 'Subst' lookupTCvSubst :: Subst -> TyVar -> Type -- cgit v1.2.1