Skip to content

Commit b9ecba3

Browse files
committed
update tests
1 parent fd516af commit b9ecba3

File tree

74 files changed

+320
-652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+320
-652
lines changed

src/test/mir-opt/exponential-or.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Test that simple or-patterns don't get expanded to exponentially large CFGs
22

3-
#![feature(or_patterns)]
4-
53
// EMIT_MIR exponential_or.match_tuple.SimplifyCfg-initial.after.mir
64
fn match_tuple(x: (u32, bool, Option<i32>, u32)) -> u32 {
75
match x {
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
11
// MIR for `match_tuple` after SimplifyCfg-initial
22

33
fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
4-
debug x => _1; // in scope 0 at $DIR/exponential-or.rs:6:16: 6:17
5-
let mut _0: u32; // return place in scope 0 at $DIR/exponential-or.rs:6:53: 6:56
6-
let mut _2: isize; // in scope 0 at $DIR/exponential-or.rs:8:37: 8:48
7-
let mut _3: bool; // in scope 0 at $DIR/exponential-or.rs:8:70: 8:77
8-
let mut _4: bool; // in scope 0 at $DIR/exponential-or.rs:8:70: 8:77
9-
let mut _5: bool; // in scope 0 at $DIR/exponential-or.rs:8:62: 8:67
10-
let mut _6: bool; // in scope 0 at $DIR/exponential-or.rs:8:62: 8:67
11-
let _7: u32; // in scope 0 at $DIR/exponential-or.rs:8:10: 8:21
12-
let _8: u32; // in scope 0 at $DIR/exponential-or.rs:8:57: 8:78
13-
let mut _9: u32; // in scope 0 at $DIR/exponential-or.rs:8:83: 8:84
14-
let mut _10: u32; // in scope 0 at $DIR/exponential-or.rs:8:87: 8:88
4+
debug x => _1; // in scope 0 at $DIR/exponential-or.rs:4:16: 4:17
5+
let mut _0: u32; // return place in scope 0 at $DIR/exponential-or.rs:4:53: 4:56
6+
let mut _2: isize; // in scope 0 at $DIR/exponential-or.rs:6:37: 6:48
7+
let mut _3: bool; // in scope 0 at $DIR/exponential-or.rs:6:70: 6:77
8+
let mut _4: bool; // in scope 0 at $DIR/exponential-or.rs:6:70: 6:77
9+
let mut _5: bool; // in scope 0 at $DIR/exponential-or.rs:6:62: 6:67
10+
let mut _6: bool; // in scope 0 at $DIR/exponential-or.rs:6:62: 6:67
11+
let _7: u32; // in scope 0 at $DIR/exponential-or.rs:6:10: 6:21
12+
let _8: u32; // in scope 0 at $DIR/exponential-or.rs:6:57: 6:78
13+
let mut _9: u32; // in scope 0 at $DIR/exponential-or.rs:6:83: 6:84
14+
let mut _10: u32; // in scope 0 at $DIR/exponential-or.rs:6:87: 6:88
1515
scope 1 {
16-
debug y => _7; // in scope 1 at $DIR/exponential-or.rs:8:10: 8:21
17-
debug z => _8; // in scope 1 at $DIR/exponential-or.rs:8:57: 8:78
16+
debug y => _7; // in scope 1 at $DIR/exponential-or.rs:6:10: 6:21
17+
debug z => _8; // in scope 1 at $DIR/exponential-or.rs:6:57: 6:78
1818
}
1919

2020
bb0: {
21-
FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/exponential-or.rs:7:11: 7:12
22-
switchInt((_1.0: u32)) -> [1_u32: bb2, 4_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:15: 8:16
21+
FakeRead(ForMatchedPlace, _1); // scope 0 at $DIR/exponential-or.rs:5:11: 5:12
22+
switchInt((_1.0: u32)) -> [1_u32: bb2, 4_u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:6:15: 6:16
2323
}
2424

2525
bb1: {
26-
_0 = const 0_u32; // scope 0 at $DIR/exponential-or.rs:9:14: 9:15
27-
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
26+
_0 = const 0_u32; // scope 0 at $DIR/exponential-or.rs:7:14: 7:15
27+
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:5:5: 8:6
2828
}
2929

3030
bb2: {
31-
_2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential-or.rs:8:37: 8:48
32-
switchInt(move _2) -> [0_isize: bb4, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:37: 8:48
31+
_2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential-or.rs:6:37: 6:48
32+
switchInt(move _2) -> [0_isize: bb4, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:6:37: 6:48
3333
}
3434

3535
bb3: {
36-
switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1_i32: bb4, 8_i32: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:42: 8:43
36+
switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1_i32: bb4, 8_i32: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:6:42: 6:43
3737
}
3838

3939
bb4: {
40-
_5 = Le(const 6_u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
41-
switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
40+
_5 = Le(const 6_u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:6:62: 6:67
41+
switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential-or.rs:6:62: 6:67
4242
}
4343

4444
bb5: {
45-
_6 = Le((_1.3: u32), const 9_u32); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
46-
switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
45+
_6 = Le((_1.3: u32), const 9_u32); // scope 0 at $DIR/exponential-or.rs:6:62: 6:67
46+
switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:6:62: 6:67
4747
}
4848

4949
bb6: {
50-
_3 = Le(const 13_u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
51-
switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
50+
_3 = Le(const 13_u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:6:70: 6:77
51+
switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential-or.rs:6:70: 6:77
5252
}
5353

5454
bb7: {
55-
_4 = Le((_1.3: u32), const 16_u32); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
56-
switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
55+
_4 = Le((_1.3: u32), const 16_u32); // scope 0 at $DIR/exponential-or.rs:6:70: 6:77
56+
switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:6:70: 6:77
5757
}
5858

5959
bb8: {
60-
falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/exponential-or.rs:8:9: 8:79
60+
falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/exponential-or.rs:6:9: 6:79
6161
}
6262

6363
bb9: {
64-
StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
65-
_7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
66-
StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
67-
_8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
68-
StorageLive(_9); // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
69-
_9 = _7; // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
70-
StorageLive(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
71-
_10 = _8; // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
72-
_0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential-or.rs:8:83: 8:88
73-
StorageDead(_10); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
74-
StorageDead(_9); // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
75-
StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
76-
StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:8:87: 8:88
77-
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
64+
StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:6:10: 6:21
65+
_7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:6:10: 6:21
66+
StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:6:57: 6:78
67+
_8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:6:57: 6:78
68+
StorageLive(_9); // scope 1 at $DIR/exponential-or.rs:6:83: 6:84
69+
_9 = _7; // scope 1 at $DIR/exponential-or.rs:6:83: 6:84
70+
StorageLive(_10); // scope 1 at $DIR/exponential-or.rs:6:87: 6:88
71+
_10 = _8; // scope 1 at $DIR/exponential-or.rs:6:87: 6:88
72+
_0 = BitXor(move _9, move _10); // scope 1 at $DIR/exponential-or.rs:6:83: 6:88
73+
StorageDead(_10); // scope 1 at $DIR/exponential-or.rs:6:87: 6:88
74+
StorageDead(_9); // scope 1 at $DIR/exponential-or.rs:6:87: 6:88
75+
StorageDead(_8); // scope 0 at $DIR/exponential-or.rs:6:87: 6:88
76+
StorageDead(_7); // scope 0 at $DIR/exponential-or.rs:6:87: 6:88
77+
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:5:5: 8:6
7878
}
7979

8080
bb10: {
81-
return; // scope 0 at $DIR/exponential-or.rs:11:2: 11:2
81+
return; // scope 0 at $DIR/exponential-or.rs:9:2: 9:2
8282
}
8383
}

src/test/mir-opt/issues/issue-75439.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff
22

33
#![feature(const_fn_transmute)]
4-
#![feature(or_patterns)]
54

65
use std::mem::transmute;
76

src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff

+39-39
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
+ // MIR for `foo` after MatchBranchSimplification
33

44
fn foo(_1: [u8; 16]) -> Option<[u8; 4]> {
5-
debug bytes => _1; // in scope 0 at $DIR/issue-75439.rs:8:12: 8:17
6-
let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue-75439.rs:8:32: 8:47
7-
let _2: [u32; 4]; // in scope 0 at $DIR/issue-75439.rs:10:9: 10:15
8-
let mut _3: [u8; 16]; // in scope 0 at $DIR/issue-75439.rs:10:47: 10:52
9-
let mut _5: [u8; 4]; // in scope 0 at $DIR/issue-75439.rs:13:14: 13:38
10-
let mut _6: u32; // in scope 0 at $DIR/issue-75439.rs:13:33: 13:35
5+
debug bytes => _1; // in scope 0 at $DIR/issue-75439.rs:7:12: 7:17
6+
let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue-75439.rs:7:32: 7:47
7+
let _2: [u32; 4]; // in scope 0 at $DIR/issue-75439.rs:9:9: 9:15
8+
let mut _3: [u8; 16]; // in scope 0 at $DIR/issue-75439.rs:9:47: 9:52
9+
let mut _5: [u8; 4]; // in scope 0 at $DIR/issue-75439.rs:12:14: 12:38
10+
let mut _6: u32; // in scope 0 at $DIR/issue-75439.rs:12:33: 12:35
1111
scope 1 {
12-
debug dwords => _2; // in scope 1 at $DIR/issue-75439.rs:10:9: 10:15
13-
let _4: u32; // in scope 1 at $DIR/issue-75439.rs:12:27: 12:29
12+
debug dwords => _2; // in scope 1 at $DIR/issue-75439.rs:9:9: 9:15
13+
let _4: u32; // in scope 1 at $DIR/issue-75439.rs:11:27: 11:29
1414
scope 3 {
15-
debug ip => _4; // in scope 3 at $DIR/issue-75439.rs:12:27: 12:29
15+
debug ip => _4; // in scope 3 at $DIR/issue-75439.rs:11:27: 11:29
1616
scope 4 {
1717
}
1818
}
@@ -21,67 +21,67 @@
2121
}
2222

2323
bb0: {
24-
StorageLive(_2); // scope 0 at $DIR/issue-75439.rs:10:9: 10:15
25-
StorageLive(_3); // scope 2 at $DIR/issue-75439.rs:10:47: 10:52
26-
_3 = _1; // scope 2 at $DIR/issue-75439.rs:10:47: 10:52
27-
_2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:10:37: 10:53
24+
StorageLive(_2); // scope 0 at $DIR/issue-75439.rs:9:9: 9:15
25+
StorageLive(_3); // scope 2 at $DIR/issue-75439.rs:9:47: 9:52
26+
_3 = _1; // scope 2 at $DIR/issue-75439.rs:9:47: 9:52
27+
_2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:9:37: 9:53
2828
// mir::Constant
29-
// + span: $DIR/issue-75439.rs:10:37: 10:46
29+
// + span: $DIR/issue-75439.rs:9:37: 9:46
3030
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {std::intrinsics::transmute::<[u8; 16], [u32; 4]>}, val: Value(Scalar(<ZST>)) }
3131
}
3232

3333
bb1: {
34-
StorageDead(_3); // scope 2 at $DIR/issue-75439.rs:10:52: 10:53
35-
switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:12:13: 12:14
34+
StorageDead(_3); // scope 2 at $DIR/issue-75439.rs:9:52: 9:53
35+
switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:13: 11:14
3636
}
3737

3838
bb2: {
39-
switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:12:16: 12:17
39+
switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:16: 11:17
4040
}
4141

4242
bb3: {
43-
switchInt(_2[2 of 4]) -> [0_u32: bb6, 4294901760_u32: bb7, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:12:19: 12:20
43+
switchInt(_2[2 of 4]) -> [0_u32: bb6, 4294901760_u32: bb7, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:19: 11:20
4444
}
4545

4646
bb4: {
47-
discriminant(_0) = 0; // scope 1 at $DIR/issue-75439.rs:15:9: 15:13
48-
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:12:5: 16:6
47+
discriminant(_0) = 0; // scope 1 at $DIR/issue-75439.rs:14:9: 14:13
48+
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
4949
}
5050

5151
bb5: {
52-
StorageLive(_5); // scope 3 at $DIR/issue-75439.rs:13:14: 13:38
53-
StorageLive(_6); // scope 4 at $DIR/issue-75439.rs:13:33: 13:35
54-
_6 = _4; // scope 4 at $DIR/issue-75439.rs:13:33: 13:35
55-
_5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:13:23: 13:36
52+
StorageLive(_5); // scope 3 at $DIR/issue-75439.rs:12:14: 12:38
53+
StorageLive(_6); // scope 4 at $DIR/issue-75439.rs:12:33: 12:35
54+
_6 = _4; // scope 4 at $DIR/issue-75439.rs:12:33: 12:35
55+
_5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:12:23: 12:36
5656
// mir::Constant
57-
// + span: $DIR/issue-75439.rs:13:23: 13:32
57+
// + span: $DIR/issue-75439.rs:12:23: 12:32
5858
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {std::intrinsics::transmute::<u32, [u8; 4]>}, val: Value(Scalar(<ZST>)) }
5959
}
6060

6161
bb6: {
62-
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:12:27: 12:29
63-
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:12:27: 12:29
64-
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:12:5: 16:6
62+
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
63+
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
64+
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
6565
}
6666

6767
bb7: {
68-
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:12:27: 12:29
69-
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:12:27: 12:29
70-
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:12:5: 16:6
68+
StorageLive(_4); // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
69+
_4 = _2[3 of 4]; // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
70+
goto -> bb5; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
7171
}
7272

7373
bb8: {
74-
StorageDead(_6); // scope 4 at $DIR/issue-75439.rs:13:35: 13:36
75-
((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:13:9: 13:39
76-
discriminant(_0) = 1; // scope 3 at $DIR/issue-75439.rs:13:9: 13:39
77-
StorageDead(_5); // scope 3 at $DIR/issue-75439.rs:13:38: 13:39
78-
StorageDead(_4); // scope 1 at $DIR/issue-75439.rs:14:5: 14:6
79-
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:12:5: 16:6
74+
StorageDead(_6); // scope 4 at $DIR/issue-75439.rs:12:35: 12:36
75+
((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:12:9: 12:39
76+
discriminant(_0) = 1; // scope 3 at $DIR/issue-75439.rs:12:9: 12:39
77+
StorageDead(_5); // scope 3 at $DIR/issue-75439.rs:12:38: 12:39
78+
StorageDead(_4); // scope 1 at $DIR/issue-75439.rs:13:5: 13:6
79+
goto -> bb9; // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
8080
}
8181

8282
bb9: {
83-
StorageDead(_2); // scope 0 at $DIR/issue-75439.rs:17:1: 17:2
84-
return; // scope 0 at $DIR/issue-75439.rs:17:2: 17:2
83+
StorageDead(_2); // scope 0 at $DIR/issue-75439.rs:16:1: 16:2
84+
return; // scope 0 at $DIR/issue-75439.rs:16:2: 16:2
8585
}
8686
}
8787

src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Tests using a combination of pattern features has the expected borrow checking behavior
22
#![feature(bindings_after_at)]
3-
#![feature(or_patterns)]
43
#![feature(box_patterns)]
54

65
enum Test {

0 commit comments

Comments
 (0)