-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Closed
Copy link
Labels
A-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.
Description
After MIR inlining, this example (see on godbolt):
fn foo() {
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-mir-opt-inliningArea: MIR inliningArea: MIR inliningC-bugCategory: This is a bug.Category: This is a bug.