about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/mir-opt/box_expr.rs1
-rw-r--r--src/test/mir-opt/issue-49232.rs21
-rw-r--r--src/test/mir-opt/match_false_edges.rs143
-rw-r--r--src/test/mir-opt/validate_1.rs1
-rw-r--r--src/test/mir-opt/validate_2.rs1
-rw-r--r--src/test/mir-opt/validate_3.rs2
6 files changed, 88 insertions, 81 deletions
diff --git a/src/test/mir-opt/box_expr.rs b/src/test/mir-opt/box_expr.rs
index f6877d979e0..8390a0d19ae 100644
--- a/src/test/mir-opt/box_expr.rs
+++ b/src/test/mir-opt/box_expr.rs
@@ -63,7 +63,6 @@ impl Drop for S {
 //
 //     bb4: {
 //         StorageDead(_2);
-//         FakeRead(ForLet, _1);
 //         StorageLive(_4);
 //         _4 = move _1;
 //         _3 = const std::mem::drop(move _4) -> [return: bb5, unwind: bb7];
diff --git a/src/test/mir-opt/issue-49232.rs b/src/test/mir-opt/issue-49232.rs
index 3bc735bc6c5..f9024b67063 100644
--- a/src/test/mir-opt/issue-49232.rs
+++ b/src/test/mir-opt/issue-49232.rs
@@ -34,10 +34,9 @@ fn main() {
 //     }
 //     let mut _1: ();
 //     let mut _3: bool;
-//     let mut _4: u8;
-//     let mut _5: !;
-//     let mut _6: ();
-//     let mut _7: &i32;
+//     let mut _4: !;
+//     let mut _5: ();
+//     let mut _6: &i32;
 //     bb0: {
 //         goto -> bb1;
 //     }
@@ -51,7 +50,7 @@ fn main() {
 //         StorageLive(_2);
 //         StorageLive(_3);
 //         _3 = const true;
-//         _4 = discriminant(_3);
+//         FakeRead(ForMatchedPlace, _3);
 //         switchInt(_3) -> [false: bb11, otherwise: bb10];
 //     }
 //     bb4: {
@@ -89,9 +88,9 @@ fn main() {
 //     bb14: {
 //         FakeRead(ForLet, _2);
 //         StorageDead(_3);
-//         StorageLive(_7);
-//         _7 = &_2;
-//         _6 = const std::mem::drop(move _7) -> [return: bb28, unwind: bb4];
+//         StorageLive(_6);
+//         _6 = &_2;
+//         _5 = const std::mem::drop(move _6) -> [return: bb28, unwind: bb4];
 //     }
 //     bb15: {
 //         goto -> bb16;
@@ -129,15 +128,15 @@ fn main() {
 //         goto -> bb2;
 //     }
 //     bb26: {
-//         _5 = ();
+//         _4 = ();
 //         unreachable;
 //     }
 //     bb27: {
-//         StorageDead(_5);
+//         StorageDead(_4);
 //         goto -> bb14;
 //     }
 //     bb28: {
-//         StorageDead(_7);
+//         StorageDead(_6);
 //         _1 = ();
 //         StorageDead(_2);
 //         goto -> bb1;
diff --git a/src/test/mir-opt/match_false_edges.rs b/src/test/mir-opt/match_false_edges.rs
index b9f4c239127..9ccf0371399 100644
--- a/src/test/mir-opt/match_false_edges.rs
+++ b/src/test/mir-opt/match_false_edges.rs
@@ -53,10 +53,11 @@ fn main() {
 //  bb0: {
 //      ...
 //      _2 = std::option::Option<i32>::Some(const 42i32,);
-//      _3 = discriminant(_2);
-//      _4 = &(promoted[1]: std::option::Option<i32>);
-//      _9 = discriminant(_2);
-//      switchInt(move _9) -> [0isize: bb5, 1isize: bb3, otherwise: bb7];
+//      FakeRead(ForMatchedPlace, _2);
+//      _7 = discriminant(_2);
+//      _9 = &shallow (promoted[2]: std::option::Option<i32>);
+//      _10 = &(((promoted[1]: std::option::Option<i32>) as Some).0: i32);
+//      switchInt(move _7) -> [0isize: bb5, 1isize: bb3, otherwise: bb7];
 //  }
 //  bb1: {
 //      resume;
@@ -66,15 +67,18 @@ fn main() {
 //      goto -> bb13;
 //  }
 //  bb3: { // binding3(empty) and arm3
-//      FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _9);
+//      FakeRead(ForMatchGuard, _10);
 //      falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1
 //  }
 //  bb4: {
-//      FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _9);
+//      FakeRead(ForMatchGuard, _10);
 //      falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding2
 //  }
 //  bb5: {
-//      FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _9);
+//      FakeRead(ForMatchGuard, _10);
 //      falseEdges -> [real: bb2, imaginary: bb6]; //pre_binding3
 //  }
 //  bb6: {
@@ -84,31 +88,31 @@ fn main() {
 //      unreachable;
 //  }
 //  bb8: { // binding1 and guard
-//      StorageLive(_7);
-//      _7 = &(((promoted[0]: std::option::Option<i32>) as Some).0: i32);
-//      StorageLive(_10);
-//      _10 = const guard() -> [return: bb9, unwind: bb1];
+//      StorageLive(_5);
+//      _5 = &(((promoted[0]: std::option::Option<i32>) as Some).0: i32);
+//      StorageLive(_8);
+//      _8 = const guard() -> [return: bb9, unwind: bb1];
 //  }
 //  bb9: {
-//      switchInt(move _10) -> [false: bb10, otherwise: bb11];
+//      switchInt(move _8) -> [false: bb10, otherwise: bb11];
 //  }
 //  bb10: { // to pre_binding2
 //      falseEdges -> [real: bb4, imaginary: bb4];
 //  }
 //  bb11: { // bindingNoLandingPads.before.mir2 and arm2
-//      StorageLive(_5);
-//      _5 = ((_2 as Some).0: i32);
+//      StorageLive(_3);
+//      _3 = ((_2 as Some).0: i32);
 //      StorageLive(_11);
-//      _11 = _5;
+//      _11 = _3;
 //      _1 = (const 1i32, move _11);
 //      StorageDead(_11);
 //      goto -> bb13;
 //  }
 //  bb12: {
-//      StorageLive(_8);
-//      _8 = ((_2 as Some).0: i32);
+//      StorageLive(_6);
+//      _6 = ((_2 as Some).0: i32);
 //      StorageLive(_12);
-//      _12 = _8;
+//      _12 = _6;
 //      _1 = (const 2i32, move_12);
 //      StorageDead(_12);
 //      goto -> bb13;
@@ -123,10 +127,11 @@ fn main() {
 //  bb0: {
 //      ...
 //      _2 = std::option::Option<i32>::Some(const 42i32,);
-//      _3 = discriminant(_2);
-//      _4 = &_2;
-//      _9 = discriminant(_2);
-//      switchInt(move _9) -> [0isize: bb4, 1isize: bb3, otherwise: bb7];
+//      FakeRead(ForMatchedPlace, _2);
+//      _7 = discriminant(_2);
+//      _9 = &shallow _2;
+//      _10 = &((_2 as Some).0: i32);
+//      switchInt(move _7) -> [0isize: bb4, 1isize: bb3, otherwise: bb7];
 //  }
 //  bb1: {
 //      resume;
@@ -136,15 +141,18 @@ fn main() {
 //      goto -> bb13;
 //  }
 //  bb3: {
-//      FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _9);
+//      FakeRead(ForMatchGuard, _10);
 //      falseEdges -> [real: bb8, imaginary: bb4]; //pre_binding1
 //  }
 //  bb4: {
-//      FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _9);
+//      FakeRead(ForMatchGuard, _10);
 //      falseEdges -> [real: bb2, imaginary: bb5]; //pre_binding2
 //  }
 //  bb5: {
-//      FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _9);
+//      FakeRead(ForMatchGuard, _10);
 //      falseEdges -> [real: bb12, imaginary: bb6]; //pre_binding3
 //  }
 //  bb6: {
@@ -154,31 +162,31 @@ fn main() {
 //      unreachable;
 //  }
 //  bb8: { // binding1 and guard
-//      StorageLive(_7);
-//      _7 = &((_2 as Some).0: i32);
-//      StorageLive(_10);
-//      _10 = const guard() -> [return: bb9, unwind: bb1];
+//      StorageLive(_5);
+//      _5 = &((_2 as Some).0: i32);
+//      StorageLive(_8);
+//      _8 = const guard() -> [return: bb9, unwind: bb1];
 //  }
 //  bb9: { // end of guard
-//      switchInt(move _10) -> [false: bb10, otherwise: bb11];
+//      switchInt(move _8) -> [false: bb10, otherwise: bb11];
 //  }
 //  bb10: { // to pre_binding3 (can skip 2 since this is `Some`)
 //      falseEdges -> [real: bb5, imaginary: bb4];
 //  }
 //  bb11: { // arm1
-//      StorageLive(_5);
-//      _5 = ((_2 as Some).0: i32);
+//      StorageLive(_3);
+//      _3 = ((_2 as Some).0: i32);
 //      StorageLive(_11);
-//      _11 = _5;
+//      _11 = _3;
 //      _1 = (const 1i32, move _11);
 //      StorageDead(_11);
 //      goto -> bb13;
 //  }
 //  bb12: { // binding3 and arm3
-//      StorageLive(_8);
-//      _8 = ((_2 as Some).0: i32);
+//      StorageLive(_6);
+//      _6 = ((_2 as Some).0: i32);
 //      StorageLive(_12);
-//      _12 = _8;
+//      _12 = _6;
 //      _1 = (const 2i32, move _12);
 //      StorageDead(_12);
 //      goto -> bb13;
@@ -193,81 +201,86 @@ fn main() {
 // bb0: {
 //     ...
 //     _2 = std::option::Option<i32>::Some(const 1i32,);
-//     _3 = discriminant(_2);
-//     _4 = &_2;
-//     _13 = discriminant(_2);
-//     switchInt(move _13) -> [1isize: bb2, otherwise: bb3];
+//     FakeRead(ForMatchedPlace, _2);
+//     _11 = discriminant(_2);
+//    _16 = &shallow _2;
+//    _17 = &((_2 as Some).0: i32);
+//     switchInt(move _11) -> [1isize: bb2, otherwise: bb3];
 // }
 // bb1: {
 //     resume;
 // }
 // bb2: {
-//     FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _16);
+//      FakeRead(ForMatchGuard, _17);
 //     falseEdges -> [real: bb7, imaginary: bb3]; //pre_binding1
 // }
 // bb3: {
-//     FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _16);
+//      FakeRead(ForMatchGuard, _17);
 //     falseEdges -> [real: bb11, imaginary: bb4]; //pre_binding2
 // }
 // bb4: {
-//     FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _16);
+//      FakeRead(ForMatchGuard, _17);
 //     falseEdges -> [real: bb12, imaginary: bb5]; //pre_binding3
 // }
 // bb5: {
-//     FakeRead(ForMatch, _4);
+//      FakeRead(ForMatchGuard, _16);
+//      FakeRead(ForMatchGuard, _17);
 //     falseEdges -> [real: bb16, imaginary: bb6]; //pre_binding4
 // }
 // bb6: {
 //     unreachable;
 // }
 // bb7: { // binding1: Some(w) if guard()
-//     StorageLive(_7);
-//     _7 = &((_2 as Some).0: i32);
-//     StorageLive(_14);
-//     _14 = const guard() -> [return: bb8, unwind: bb1];
+//     StorageLive(_5);
+//     _5 = &((_2 as Some).0: i32);
+//     StorageLive(_12);
+//     _12 = const guard() -> [return: bb8, unwind: bb1];
 // }
 // bb8: { //end of guard
-//     switchInt(move _14) -> [false: bb9, otherwise: bb10];
+//     switchInt(move _12) -> [false: bb9, otherwise: bb10];
 // }
 // bb9: { // to pre_binding2
 //     falseEdges -> [real: bb3, imaginary: bb3];
 // }
 // bb10: { // set up bindings for arm1
-//     StorageLive(_5);
-//     _5 = ((_2 as Some).0: i32);
+//     StorageLive(_3);
+//     _3 = ((_2 as Some).0: i32);
 //     _1 = const 1i32;
 //     goto -> bb17;
 // }
 // bb11: { // binding2 & arm2
-//     StorageLive(_8);
-//     _8 = _2;
+//     StorageLive(_6);
+//     _6 = _2;
 //     _1 = const 2i32;
 //     goto -> bb17;
 // }
 // bb12: { // binding3: Some(y) if guard2(y)
-//     StorageLive(_11);
-//     _11 = &((_2 as Some).0: i32);
-//     StorageLive(_16);
-//     StorageLive(_17);
-//     _17 = (*_11);
-//     _16 = const guard2(move _17) -> [return: bb13, unwind: bb1];
+//     StorageLive(_9);
+//     _9 = &((_2 as Some).0: i32);
+//     StorageLive(_14);
+//     StorageLive(_15);
+//     _15 = (*_9);
+//     _14 = const guard2(move _15) -> [return: bb13, unwind: bb1];
 // }
 // bb13: { // end of guard2
-//     StorageDead(_17);
-//     switchInt(move _16) -> [false: bb14, otherwise: bb15];
+//     StorageDead(_15);
+//     switchInt(move _14) -> [false: bb14, otherwise: bb15];
 // }
 // bb14: { // to pre_binding4
 //     falseEdges -> [real: bb5, imaginary: bb5];
 // }
 // bb15: { // set up bindings for arm3
-//     StorageLive(_9);
-//     _9 = ((_2 as Some).0: i32);
+//     StorageLive(_7);
+//     _7 = ((_2 as Some).0: i32);
 //     _1 = const 3i32;
 //     goto -> bb17;
 // }
 // bb16: { // binding4 & arm4
-//     StorageLive(_12);
-//     _12 = _2;
+//     StorageLive(_10);
+//     _10 = _2;
 //     _1 = const 4i32;
 //     goto -> bb17;
 // }
diff --git a/src/test/mir-opt/validate_1.rs b/src/test/mir-opt/validate_1.rs
index 3ea8e99e953..882579c5710 100644
--- a/src/test/mir-opt/validate_1.rs
+++ b/src/test/mir-opt/validate_1.rs
@@ -67,7 +67,6 @@ fn main() {
 //         Validate(Suspend(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 })), [(*_2): i32]);
 //         _3 = &ReErased (*_2);
 //         Validate(Acquire, [(*_3): i32/ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }) (imm)]);
-//         FakeRead(ForLet, _3);
 //         _0 = (*_3);
 //         EndRegion(ReScope(Remainder { block: ItemLocalId(25), first_statement_index: 0 }));
 //         StorageDead(_3);
diff --git a/src/test/mir-opt/validate_2.rs b/src/test/mir-opt/validate_2.rs
index 0cb0b7debfa..3776a11b3ab 100644
--- a/src/test/mir-opt/validate_2.rs
+++ b/src/test/mir-opt/validate_2.rs
@@ -28,7 +28,6 @@ fn main() {
 //         Validate(Acquire, [_1: std::boxed::Box<[i32]>]);
 //         StorageDead(_2);
 //         StorageDead(_3);
-//         FakeRead(ForLet, _1);
 //         _0 = ();
 //         Validate(Release, [_1: std::boxed::Box<[i32]>]);
 //         drop(_1) -> [return: bb2, unwind: bb3];
diff --git a/src/test/mir-opt/validate_3.rs b/src/test/mir-opt/validate_3.rs
index 89b67bd34c8..07f5b2aa84b 100644
--- a/src/test/mir-opt/validate_3.rs
+++ b/src/test/mir-opt/validate_3.rs
@@ -47,12 +47,10 @@ fn main() {
 //     bb0: {
 //         StorageLive(_1);
 //         _1 = Test { x: const 0i32 };
-//         FakeRead(ForLet, _1);
 //         StorageLive(_2);
 //         Validate(Suspend(ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 })), [_1: Test]);
 //         _2 = &ReErased _1;
 //         Validate(Acquire, [(*_2): Test/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);
-//         FakeRead(ForLet, _2);
 //         StorageLive(_4);
 //         StorageLive(_5);
 //         Validate(Suspend(ReScope(Node(ItemLocalId(18)))), [((*_2).0: i32): i32/ReScope(Remainder { block: ItemLocalId(20), first_statement_index: 3 }) (imm)]);