-substInlineRuleInfo subst (InlWrapper wkr)
- = case lookupIdSubst subst wkr of
- Var w1 -> InlWrapper w1
- other -> WARN( not (exprIsTrivial other), text "CoreSubst.substWorker:" <+> ppr wkr )
- InlVanilla -- Worker has got substituted away altogether
- -- (This can happen if it's trivial, via
- -- postInlineUnconditionally, hence only warning)
+substInlineRuleInfo (Subst in_scope ids _) (InlWrapper wkr)
+ | Just (Var w1) <- lookupVarEnv ids wkr = InlWrapper w1
+ | Just w1 <- lookupInScope in_scope wkr = InlWrapper w1
+ | otherwise = WARN( True, text "Interesting! CoreSubst.substWorker:" <+> ppr wkr )
+ InlVanilla -- Note [Worker inlining]