You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After MIR inlining, this example (see on godbolt):
fnfoo(){let f = |x| {let y = x; y };f(())}
produces this scope shape (I've removed all the lets and spans):
scope 1{
debug f => _1;
scope 2{
debug x => _4;}}
scope 3{
debug y => _3;}
You can see x is properly located, in the inlined outermost callee scope (2) as a child of the callsite scope (1).
But y isn't, as its scope (3) keeps the original parent_scope (0) it had in the callee body, pre-inlining.
Will try to fix this as part of #68965, or maybe open a separate PR if I can shuffle the commits around.
cc @rust-lang/wg-mir-opt
The text was updated successfully, but these errors were encountered:
After MIR inlining, this example (see on godbolt):
produces this scope shape (I've removed all the
let
s and spans):You can see
x
is properly located, in the inlined outermost callee scope (2) as a child of the callsite scope (1).But
y
isn't, as its scope (3) keeps the originalparent_scope
(0) it had in the callee body, pre-inlining.Will try to fix this as part of #68965, or maybe open a separate PR if I can shuffle the commits around.
cc @rust-lang/wg-mir-opt
The text was updated successfully, but these errors were encountered: