2024-04-14 18:22:35 -07:00
|
|
|
//@ compile-flags: -C debuginfo=full
|
2020-09-21 07:13:34 +03:00
|
|
|
// Tests that MIR inliner can handle `SourceScopeData` parenting correctly. (#76997)
|
|
|
|
|
|
|
|
// EMIT_MIR issue_76997_inline_scopes_parenting.main.Inline.after.mir
|
|
|
|
fn main() {
|
2023-10-20 21:57:08 -07:00
|
|
|
// CHECK-LABEL: fn main(
|
2023-10-22 09:27:43 -07:00
|
|
|
// CHECK: scope 1 {
|
|
|
|
// CHECK-NEXT: debug f
|
|
|
|
// CHECK-NEXT: scope 2 (inlined main::{closure#0}) {
|
2023-10-20 21:57:08 -07:00
|
|
|
// CHECK-NEXT: debug x
|
2023-10-22 09:27:43 -07:00
|
|
|
// CHECK-NEXT: scope 3 {
|
2023-10-20 21:57:08 -07:00
|
|
|
// CHECK-NEXT: debug y
|
2023-10-22 09:27:43 -07:00
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
|
|
|
// CHECK-NEXT: }
|
2024-06-03 10:18:33 +10:00
|
|
|
let f = |x| {
|
|
|
|
let y = x;
|
|
|
|
y
|
|
|
|
};
|
2020-09-21 07:13:34 +03:00
|
|
|
f(())
|
|
|
|
}
|