about summary refs log tree commit diff
path: root/tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-07-09 20:00:59 +0000
committerMichael Goulet <michael@errs.io>2025-07-18 16:35:55 +0000
commit3b9c16bc0e90e57ed4ff548a50a577ea4dd7a50c (patch)
tree8d073efa8ba522a57a392d09a1dbe4b852422bc3 /tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff
parent82310651b93a594a3fd69015e1562186a080d94c (diff)
downloadrust-3b9c16bc0e90e57ed4ff548a50a577ea4dd7a50c.tar.gz
rust-3b9c16bc0e90e57ed4ff548a50a577ea4dd7a50c.zip
Be a bit more careful around exotic cycles in in the inliner
Diffstat (limited to 'tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff')
-rw-r--r--tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff b/tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff
new file mode 100644
index 00000000000..55da685a3d4
--- /dev/null
+++ b/tests/mir-opt/inline_double_cycle.a.Inline.panic-unwind.diff
@@ -0,0 +1,48 @@
+- // MIR for `a` before Inline
++ // MIR for `a` after Inline
+  
+  fn a() -> () {
+      let mut _0: ();
+      let _1: ();
+      let mut _2: ();
+      let _3: ();
+      let mut _4: ();
++     let mut _5: fn() {a};
++     let mut _6: fn() {b};
++     scope 1 (inlined <fn() {a} as FnOnce<()>>::call_once - shim(fn() {a})) {
++     }
++     scope 2 (inlined <fn() {b} as FnOnce<()>>::call_once - shim(fn() {b})) {
++     }
+  
+      bb0: {
+          StorageLive(_1);
+          StorageLive(_2);
+          _2 = ();
+-         _1 = <fn() {a} as FnOnce<()>>::call_once(a, move _2) -> [return: bb1, unwind continue];
++         StorageLive(_5);
++         _5 = a;
++         _1 = move _5() -> [return: bb1, unwind continue];
+      }
+  
+      bb1: {
++         StorageDead(_5);
+          StorageDead(_2);
+          StorageDead(_1);
+          StorageLive(_3);
+          StorageLive(_4);
+          _4 = ();
+-         _3 = <fn() {b} as FnOnce<()>>::call_once(b, move _4) -> [return: bb2, unwind continue];
++         StorageLive(_6);
++         _6 = b;
++         _3 = move _6() -> [return: bb2, unwind continue];
+      }
+  
+      bb2: {
++         StorageDead(_6);
+          StorageDead(_4);
+          StorageDead(_3);
+          _0 = const ();
+          return;
+      }
+  }
+