rust/tests/mir-opt/inline/issue_76997_inline_scopes_parenting.rs
Nicholas Nethercote c9c80d2c5f rustfmt tests/mir-opt.
The only non-obvious changes:
- `building/storage_live_dead_in_statics.rs` has a `#[rustfmt::skip]`
  attribute to avoid reformating a table of data.
- Two `.mir` files have slight changes involving line numbers.
- In `unusual_item_types.rs` an `EMIT_MIR` annotation is moved to
  outside a function, which is the usual spot, because `tidy` complains
  if such a comment is indented.

The commit also tweaks the comments in `rustfmt.toml`.
2024-06-03 14:17:16 +10:00

22 lines
554 B
Rust

//@ compile-flags: -C debuginfo=full
// Tests that MIR inliner can handle `SourceScopeData` parenting correctly. (#76997)
// EMIT_MIR issue_76997_inline_scopes_parenting.main.Inline.after.mir
fn main() {
// CHECK-LABEL: fn main(
// CHECK: scope 1 {
// CHECK-NEXT: debug f
// CHECK-NEXT: scope 2 (inlined main::{closure#0}) {
// CHECK-NEXT: debug x
// CHECK-NEXT: scope 3 {
// CHECK-NEXT: debug y
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: }
let f = |x| {
let y = x;
y
};
f(())
}