about summary refs log tree commit diff
path: root/tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-01-11 20:50:25 +0000
committerMichael Goulet <michael@errs.io>2025-01-11 20:50:39 +0000
commitf1d622678b330ba7640d76a8adbf5a2fdbee73cc (patch)
tree866be3d40427f7a3818faafd93be0e7ccec44044 /tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff
parentfb65a3ee576feab95a632eb062f466d7a0342310 (diff)
downloadrust-f1d622678b330ba7640d76a8adbf5a2fdbee73cc.tar.gz
rust-f1d622678b330ba7640d76a8adbf5a2fdbee73cc.zip
Make MIR cleanup for functions with impossible predicates into a real MIR pass
Diffstat (limited to 'tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff')
-rw-r--r--tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff b/tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff
new file mode 100644
index 00000000000..46d1ca7464c
--- /dev/null
+++ b/tests/mir-opt/impossible_predicates.impossible_predicate.ImpossiblePredicates.diff
@@ -0,0 +1,30 @@
+- // MIR for `impossible_predicate` before ImpossiblePredicates
++ // MIR for `impossible_predicate` after ImpossiblePredicates
+  
+  fn impossible_predicate(_1: &mut i32) -> (&mut i32, &mut i32) {
+-     debug x => _1;
+      let mut _0: (&mut i32, &mut i32);
+-     let _2: &mut i32;
+-     let mut _3: &mut i32;
+-     let mut _4: &mut i32;
+      scope 1 {
+-         debug y => _2;
+      }
+  
+      bb0: {
+-         StorageLive(_2);
+-         _2 = copy _1;
+-         FakeRead(ForLet(None), _2);
+-         StorageLive(_3);
+-         _3 = &mut (*_2);
+-         StorageLive(_4);
+-         _4 = &mut (*_1);
+-         _0 = (move _3, move _4);
+-         StorageDead(_4);
+-         StorageDead(_3);
+-         StorageDead(_2);
+-         return;
++         unreachable;
+      }
+  }
+