Skip to content

Commit 9a926f9

Browse files
committed
Fix mir-opt tests
1 parent 1f5fb7b commit 9a926f9

7 files changed

+166
-164
lines changed

src/test/mir-opt/const-promotion-extern-static.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ fn main() {}
1919
// _3 = [move _4];
2020
// _2 = &_3;
2121
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
22-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
22+
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
2323
// }
24-
// ...
25-
// bb2: {
24+
// bb1: {
2625
// StorageDead(_5);
2726
// StorageDead(_3);
2827
// return;
@@ -36,10 +35,9 @@ fn main() {}
3635
// _3 = [move _4];
3736
// _2 = &_3;
3837
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
39-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
38+
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
4039
// }
41-
// ...
42-
// bb2: {
40+
// bb1: {
4341
// StorageDead(_5);
4442
// StorageDead(_3);
4543
// return;
@@ -51,10 +49,9 @@ fn main() {}
5149
// _6 = const BAR::promoted[0];
5250
// _2 = &(*_6);
5351
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
54-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
52+
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
5553
// }
56-
// ...
57-
// bb2: {
54+
// bb1: {
5855
// return;
5956
// }
6057
// END rustc.BAR.PromoteTemps.after.mir
@@ -64,10 +61,9 @@ fn main() {}
6461
// _6 = const FOO::promoted[0];
6562
// _2 = &(*_6);
6663
// _1 = move _2 as &[&'static i32] (Pointer(Unsize));
67-
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1];
64+
// _0 = const core::slice::<impl [&'static i32]>::as_ptr(move _1) -> bb1;
6865
// }
69-
// ...
70-
// bb2: {
66+
// bb1: {
7167
// return;
7268
// }
7369
// END rustc.FOO.PromoteTemps.after.mir

src/test/mir-opt/generator-storage-dead-unwind.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -53,61 +53,61 @@ fn main() {
5353
// }
5454
// bb1: {
5555
// ...
56-
// StorageLive(_7);
57-
// _7 = move _2;
58-
// _6 = const take::<Foo>(move _7) -> [return: bb2, unwind: bb9];
56+
// StorageLive(_8);
57+
// _8 = move _3;
58+
// _7 = const take::<Foo>(move _8) -> [return: bb2, unwind: bb9];
5959
// }
6060
// bb2: {
6161
// StorageDead(_8);
6262
// StorageDead(_7);
6363
// StorageLive(_9);
64-
// _9 = move _3;
65-
// _8 = const take::<Bar>(move _9) -> [return: bb3, unwind: bb8];
64+
// StorageLive(_10);
65+
// _10 = move _4;
66+
// _9 = const take::<Bar>(move _10) -> [return: bb3, unwind: bb8];
6667
// }
6768
// bb3: {
6869
// StorageDead(_10);
6970
// StorageDead(_9);
7071
// ...
7172
// StorageDead(_4);
7273
// StorageDead(_3);
73-
// StorageDead(_2);
7474
// drop(_1) -> [return: bb4, unwind: bb11];
7575
// }
7676
// bb4: {
7777
// return;
7878
// }
7979
// bb5: {
8080
// ...
81-
// StorageDead(_3);
82-
// drop(_2) -> [return: bb6, unwind: bb12];
81+
// StorageDead(_4);
82+
// drop(_3) -> [return: bb6, unwind: bb12];
8383
// }
8484
// bb6: {
85-
// StorageDead(_2);
85+
// StorageDead(_3);
8686
// drop(_1) -> [return: bb7, unwind: bb11];
8787
// }
8888
// bb7: {
8989
// generator_drop;
9090
// }
9191
// bb8 (cleanup): {
92+
// StorageDead(_10);
9293
// StorageDead(_9);
93-
// StorageDead(_8);
9494
// goto -> bb10;
9595
// }
9696
// bb9 (cleanup): {
97+
// StorageDead(_8);
9798
// StorageDead(_7);
98-
// StorageDead(_6);
9999
// goto -> bb10;
100100
// }
101101
// bb10 (cleanup): {
102+
// StorageDead(_4);
102103
// StorageDead(_3);
103-
// StorageDead(_2);
104104
// drop(_1) -> bb11;
105105
// }
106106
// bb11 (cleanup): {
107107
// resume;
108108
// }
109109
// bb12 (cleanup): {
110-
// StorageDead(_2);
110+
// StorageDead(_3);
111111
// drop(_1) -> bb11;
112112
// }
113113

src/test/mir-opt/inline/inline-into-box-place.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ fn main() {
2020
// StorageLive(_1);
2121
// StorageLive(_2);
2222
// _2 = Box(std::vec::Vec<u32>);
23-
// (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4];
23+
// (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb1, unwind: bb4];
2424
// }
25-
// bb1 (cleanup): {
26-
// resume;
27-
// }
28-
// bb2: {
25+
// bb1: {
2926
// _1 = move _2;
3027
// StorageDead(_2);
3128
// _0 = ();
32-
// drop(_1) -> [return: bb3, unwind: bb1];
29+
// drop(_1) -> [return: bb2, unwind: bb3];
3330
// }
34-
// bb3: {
31+
// bb2: {
3532
// StorageDead(_1);
3633
// return;
3734
// }
35+
// bb3 (cleanup): {
36+
// resume;
37+
// }
3838
// bb4 (cleanup): {
39-
// _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1;
39+
// _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb3;
4040
// }
4141
// END rustc.main.Inline.before.mir
4242
// START rustc.main.Inline.after.mir
@@ -60,13 +60,13 @@ fn main() {
6060
// _1 = move _2;
6161
// StorageDead(_2);
6262
// _0 = ();
63-
// drop(_1) -> [return: bb2, unwind: bb1];
63+
// drop(_1) -> [return: bb1, unwind: bb2];
6464
// }
65-
// bb1 (cleanup): {
66-
// resume;
67-
// }
68-
// bb2: {
65+
// bb1: {
6966
// StorageDead(_1);
7067
// return;
7168
// }
69+
// bb2 (cleanup): {
70+
// resume;
71+
// }
7272
// END rustc.main.Inline.after.mir

src/test/mir-opt/issue-62289.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,36 @@ fn main() {
2929
// bb1: {
3030
// StorageDead(_4);
3131
// _5 = discriminant(_3);
32-
// switchInt(move _5) -> [0isize: bb6, 1isize: bb3, otherwise: bb2];
32+
// switchInt(move _5) -> [0isize: bb2, 1isize: bb4, otherwise: bb3];
3333
// }
3434
// bb2: {
35-
// unreachable;
35+
// StorageLive(_10);
36+
// _10 = ((_3 as Ok).0: u32);
37+
// (*_2) = _10;
38+
// StorageDead(_10);
39+
// _1 = move _2;
40+
// drop(_2) -> [return: bb7, unwind: bb12];
3641
// }
3742
// bb3: {
43+
// unreachable;
44+
// }
45+
// bb4: {
3846
// StorageLive(_6);
3947
// _6 = ((_3 as Err).0: std::option::NoneError);
4048
// StorageLive(_8);
4149
// StorageLive(_9);
4250
// _9 = _6;
43-
// _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb4, unwind: bb13];
51+
// _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb5, unwind: bb13];
4452
// }
45-
// bb4: {
53+
// bb5: {
4654
// StorageDead(_9);
47-
// _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb5, unwind: bb13];
55+
// _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb6, unwind: bb13];
4856
// }
49-
// bb5: {
57+
// bb6: {
5058
// StorageDead(_8);
5159
// StorageDead(_6);
5260
// drop(_2) -> [return: bb9, unwind: bb11];
5361
// }
54-
// bb6: {
55-
// StorageLive(_10);
56-
// _10 = ((_3 as Ok).0: u32);
57-
// (*_2) = _10;
58-
// StorageDead(_10);
59-
// _1 = move _2;
60-
// drop(_2) -> [return: bb7, unwind: bb12];
61-
// }
6262
// bb7: {
6363
// StorageDead(_2);
6464
// _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1,);

0 commit comments

Comments
 (0)