simplCore: Correctly extend in-scope set in rule matching
Note [Matching lets] in GHC.Core.Rules claims the following: > We use GHC.Core.Subst.substBind to freshen the binding, using an > in-scope set that is the original in-scope variables plus the > rs_bndrs (currently floated let-bindings). However, previously the implementation didn't actually do extend the in-scope set with rs_bndrs. This appears to be a regression which was introduced by 4ff4d434. Reintroduce `rs_bndrs` into the in-scope set, ensuring that let-binders cannot shadow one another due to rule rewrites. Fixes #21122. (cherry picked from commit 0f7dc670)
Please register or sign in to comment