Skip to content

Commit e51d87b

Browse files
committed
bless mir-opt tests
1 parent 55354de commit e51d87b

8 files changed

Lines changed: 43 additions & 43 deletions

tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ fn test() -> Option<Vec<u32>> {
66
let mut _2: std::boxed::Box<std::mem::MaybeUninit<[u32; 1]>>;
77
let mut _3: std::boxed::Box<std::mem::MaybeUninit<[u32; 1]>>;
88
let mut _4: u32;
9-
let mut _5: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
9+
let mut _5: std::ops::ControlFlow<std::option::Option<!>, u32>;
1010
let mut _6: std::option::Option<u32>;
1111
let mut _7: isize;
12-
let _8: std::option::Option<std::convert::Infallible>;
12+
let _8: std::option::Option<!>;
1313
let mut _9: !;
14-
let mut _10: std::option::Option<std::convert::Infallible>;
14+
let mut _10: std::option::Option<!>;
1515
let _11: u32;
1616
scope 1 {
1717
debug residual => _8;
@@ -63,10 +63,10 @@ fn test() -> Option<Vec<u32>> {
6363

6464
bb5: {
6565
StorageLive(_8);
66-
_8 = copy ((_5 as Break).0: std::option::Option<std::convert::Infallible>);
66+
_8 = copy ((_5 as Break).0: std::option::Option<!>);
6767
StorageLive(_10);
6868
_10 = copy _8;
69-
_0 = <Option<Vec<u32>> as FromResidual<Option<Infallible>>>::from_residual(move _10) -> [return: bb6, unwind: bb13];
69+
_0 = <Option<Vec<u32>> as FromResidual<Option<!>>>::from_residual(move _10) -> [return: bb6, unwind: bb13];
7070
}
7171

7272
bb6: {

tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
debug x => _1;
66
let mut _0: std::result::Result<i32, i32>;
77
let mut _2: i32;
8-
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
8+
let mut _3: std::ops::ControlFlow<std::result::Result<!, i32>, i32>;
99
let mut _4: std::result::Result<i32, i32>;
1010
let mut _5: isize;
11-
let _6: std::result::Result<std::convert::Infallible, i32>;
11+
let _6: std::result::Result<!, i32>;
1212
let mut _7: !;
13-
let mut _8: std::result::Result<std::convert::Infallible, i32>;
13+
let mut _8: std::result::Result<!, i32>;
1414
let _9: i32;
1515
scope 1 {
1616
debug residual => _6;
1717
scope 2 {
18-
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
18+
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<!, i32>>>::from_residual) {
1919
let mut _14: isize;
2020
let _15: i32;
2121
let mut _16: i32;
@@ -36,7 +36,7 @@
3636
let mut _10: isize;
3737
let _11: i32;
3838
let _12: i32;
39-
let mut _13: std::result::Result<std::convert::Infallible, i32>;
39+
let mut _13: std::result::Result<!, i32>;
4040
scope 6 {
4141
}
4242
scope 7 {
@@ -70,7 +70,7 @@
7070

7171
bb3: {
7272
StorageLive(_6);
73-
_6 = copy ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
73+
_6 = copy ((_3 as Break).0: std::result::Result<!, i32>);
7474
StorageLive(_8);
7575
_8 = copy _6;
7676
StorageLive(_14);
@@ -109,8 +109,8 @@
109109
StorageLive(_12);
110110
_12 = move ((_4 as Err).0: i32);
111111
StorageLive(_13);
112-
_13 = Result::<Infallible, i32>::Err(copy _12);
113-
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13);
112+
_13 = Result::<!, i32>::Err(copy _12);
113+
_3 = ControlFlow::<Result<!, i32>, i32>::Break(move _13);
114114
StorageDead(_13);
115115
StorageDead(_12);
116116
- goto -> bb5;
@@ -120,7 +120,7 @@
120120
bb7: {
121121
StorageLive(_11);
122122
_11 = move ((_4 as Ok).0: i32);
123-
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _11);
123+
_3 = ControlFlow::<Result<!, i32>, i32>::Continue(copy _11);
124124
StorageDead(_11);
125125
- goto -> bb5;
126126
+ goto -> bb9;

tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
debug x => _1;
66
let mut _0: std::result::Result<i32, i32>;
77
let mut _2: i32;
8-
let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
8+
let mut _3: std::ops::ControlFlow<std::result::Result<!, i32>, i32>;
99
let mut _4: std::result::Result<i32, i32>;
1010
let mut _5: isize;
11-
let _6: std::result::Result<std::convert::Infallible, i32>;
11+
let _6: std::result::Result<!, i32>;
1212
let mut _7: !;
13-
let mut _8: std::result::Result<std::convert::Infallible, i32>;
13+
let mut _8: std::result::Result<!, i32>;
1414
let _9: i32;
1515
scope 1 {
1616
debug residual => _6;
1717
scope 2 {
18-
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
18+
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<!, i32>>>::from_residual) {
1919
let mut _14: isize;
2020
let _15: i32;
2121
let mut _16: i32;
@@ -36,7 +36,7 @@
3636
let mut _10: isize;
3737
let _11: i32;
3838
let _12: i32;
39-
let mut _13: std::result::Result<std::convert::Infallible, i32>;
39+
let mut _13: std::result::Result<!, i32>;
4040
scope 6 {
4141
}
4242
scope 7 {
@@ -70,7 +70,7 @@
7070

7171
bb3: {
7272
StorageLive(_6);
73-
_6 = copy ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>);
73+
_6 = copy ((_3 as Break).0: std::result::Result<!, i32>);
7474
StorageLive(_8);
7575
_8 = copy _6;
7676
StorageLive(_14);
@@ -109,8 +109,8 @@
109109
StorageLive(_12);
110110
_12 = move ((_4 as Err).0: i32);
111111
StorageLive(_13);
112-
_13 = Result::<Infallible, i32>::Err(copy _12);
113-
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _13);
112+
_13 = Result::<!, i32>::Err(copy _12);
113+
_3 = ControlFlow::<Result<!, i32>, i32>::Break(move _13);
114114
StorageDead(_13);
115115
StorageDead(_12);
116116
- goto -> bb5;
@@ -120,7 +120,7 @@
120120
bb7: {
121121
StorageLive(_11);
122122
_11 = move ((_4 as Ok).0: i32);
123-
_3 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _11);
123+
_3 = ControlFlow::<Result<!, i32>, i32>::Continue(copy _11);
124124
StorageDead(_11);
125125
- goto -> bb5;
126126
+ goto -> bb9;

tests/mir-opt/jump_threading.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn identity(x: Result<i32, i32>) -> Result<i32, i32> {
5959
// CHECK: _0 = Result::<i32, i32>::Ok(
6060
// CHECK: goto -> bb4;
6161
// CHECK: bb3: {
62-
// CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: std::result::Result<std::convert::Infallible, i32>);
62+
// CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: std::result::Result<!, i32>);
6363
// CHECK: _0 = Result::<i32, i32>::Err(
6464
// CHECK: goto -> bb4;
6565
// CHECK: bb4: {
@@ -68,11 +68,11 @@ fn identity(x: Result<i32, i32>) -> Result<i32, i32> {
6868
// CHECK: switchInt(move _5) -> [0: bb2, 1: bb3, otherwise: bb1];
6969
// CHECK: bb6: {
7070
// CHECK: {{_.*}} = move (([[x]] as Err).0: i32);
71-
// CHECK: [[controlflow]] = ControlFlow::<Result<Infallible, i32>, i32>::Break(
71+
// CHECK: [[controlflow]] = ControlFlow::<Result<!, i32>, i32>::Break(
7272
// CHECK: goto -> bb8;
7373
// CHECK: bb7: {
7474
// CHECK: {{_.*}} = move (([[x]] as Ok).0: i32);
75-
// CHECK: [[controlflow]] = ControlFlow::<Result<Infallible, i32>, i32>::Continue(
75+
// CHECK: [[controlflow]] = ControlFlow::<Result<!, i32>, i32>::Continue(
7676
// CHECK: goto -> bb9;
7777
// CHECK: bb8: {
7878
// CHECK: goto -> bb3;

tests/mir-opt/pre-codegen/option_bubble_debug.option_traits.PreCodegen.after.panic-unwind.mir

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
fn option_traits(_1: Option<u32>) -> Option<u32> {
44
debug x => _1;
55
let mut _0: std::option::Option<u32>;
6-
let mut _2: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, u32>;
6+
let mut _2: std::ops::ControlFlow<std::option::Option<!>, u32>;
77
let mut _3: isize;
88
let _4: u32;
99
let mut _5: u32;
1010
scope 1 {
11-
debug residual => const Option::<Infallible>::None;
11+
debug residual => const Option::<!>::None;
1212
scope 2 {
1313
}
1414
}
@@ -34,7 +34,7 @@ fn option_traits(_1: Option<u32>) -> Option<u32> {
3434
}
3535

3636
bb3: {
37-
_0 = ops::try_trait::residual_into_try_type::<Option<Infallible>, u32>(const Option::<Infallible>::None) -> [return: bb4, unwind continue];
37+
_0 = ops::try_trait::residual_into_try_type::<Option<!>, u32>(const Option::<!>::None) -> [return: bb4, unwind continue];
3838
}
3939

4040
bb4: {

tests/mir-opt/pre-codegen/simple_option_map.map_via_question_mark.PreCodegen.after.mir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
fn map_via_question_mark(_1: Option<i32>) -> Option<i32> {
44
debug x => _1;
55
let mut _0: std::option::Option<i32>;
6-
let mut _4: std::option::Option<std::convert::Infallible>;
7-
let mut _7: std::ops::ControlFlow<std::option::Option<std::convert::Infallible>, i32>;
6+
let mut _4: std::option::Option<!>;
7+
let mut _7: std::ops::ControlFlow<std::option::Option<!>, i32>;
88
let _8: i32;
99
let mut _9: i32;
1010
scope 1 {
11-
debug residual => const Option::<Infallible>::None;
11+
debug residual => const Option::<!>::None;
1212
scope 2 {
13-
scope 7 (inlined <Option<i32> as FromResidual<Option<Infallible>>>::from_residual) {
13+
scope 7 (inlined <Option<i32> as FromResidual<Option<!>>>::from_residual) {
1414
let mut _3: isize;
1515
let mut _5: bool;
1616
}
@@ -54,7 +54,7 @@ fn map_via_question_mark(_1: Option<i32>) -> Option<i32> {
5454
bb2: {
5555
StorageLive(_6);
5656
_6 = copy ((_1 as Some).0: i32);
57-
_7 = ControlFlow::<Option<Infallible>, i32>::Continue(copy _6);
57+
_7 = ControlFlow::<Option<!>, i32>::Continue(copy _6);
5858
StorageDead(_6);
5959
StorageDead(_2);
6060
_8 = copy ((_7 as Continue).0: i32);

tests/mir-opt/pre-codegen/simple_option_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn map_via_question_mark(x: Option<i32>) -> Option<i32> {
2929

3030
// CHECK-LABEL: fn map_via_question_mark
3131
// CHECK: [[INNER:_.+]] = copy ((_1 as Some).0: i32);
32-
// CHECK: [[TEMP1:_.+]] = ControlFlow::<Option<Infallible>, i32>::Continue(copy [[INNER]]);
32+
// CHECK: [[TEMP1:_.+]] = ControlFlow::<Option<!>, i32>::Continue(copy [[INNER]]);
3333
// CHECK: [[TEMP2:_.+]] = copy (([[TEMP1]] as Continue).0: i32);
3434
// CHECK: [[SUCC:_.+]] = Add({{copy|move}} [[TEMP2]], const 1_i32);
3535
// CHECK: _0 = Option::<i32>::Some({{copy|move}} [[SUCC]]);

tests/mir-opt/separate_const_switch.identity.JumpThreading.diff

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
55
debug x => _1;
66
let mut _0: std::result::Result<i32, i32>;
7-
let mut _2: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>;
7+
let mut _2: std::ops::ControlFlow<std::result::Result<!, i32>, i32>;
88
let mut _3: isize;
9-
let _4: std::result::Result<std::convert::Infallible, i32>;
9+
let _4: std::result::Result<!, i32>;
1010
let _5: i32;
1111
scope 1 {
1212
debug residual => _4;
1313
scope 2 {
14-
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) {
14+
scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<!, i32>>>::from_residual) {
1515
let mut _10: isize;
1616
let _11: i32;
1717
let mut _12: bool;
@@ -31,7 +31,7 @@
3131
let mut _6: isize;
3232
let _7: i32;
3333
let _8: i32;
34-
let mut _9: std::result::Result<std::convert::Infallible, i32>;
34+
let mut _9: std::result::Result<!, i32>;
3535
scope 6 {
3636
}
3737
scope 7 {
@@ -58,7 +58,7 @@
5858

5959
bb3: {
6060
StorageLive(_4);
61-
_4 = copy ((_2 as Break).0: std::result::Result<std::convert::Infallible, i32>);
61+
_4 = copy ((_2 as Break).0: std::result::Result<!, i32>);
6262
StorageLive(_10);
6363
StorageLive(_12);
6464
_10 = discriminant(_4);
@@ -85,8 +85,8 @@
8585
StorageLive(_8);
8686
_8 = copy ((_1 as Err).0: i32);
8787
StorageLive(_9);
88-
_9 = Result::<Infallible, i32>::Err(copy _8);
89-
_2 = ControlFlow::<Result<Infallible, i32>, i32>::Break(move _9);
88+
_9 = Result::<!, i32>::Err(copy _8);
89+
_2 = ControlFlow::<Result<!, i32>, i32>::Break(move _9);
9090
StorageDead(_9);
9191
StorageDead(_8);
9292
- goto -> bb4;
@@ -96,7 +96,7 @@
9696
bb6: {
9797
StorageLive(_7);
9898
_7 = copy ((_1 as Ok).0: i32);
99-
_2 = ControlFlow::<Result<Infallible, i32>, i32>::Continue(copy _7);
99+
_2 = ControlFlow::<Result<!, i32>, i32>::Continue(copy _7);
100100
StorageDead(_7);
101101
- goto -> bb4;
102102
+ goto -> bb8;

0 commit comments

Comments
 (0)