Skip to content

Commit 80cc500

Browse files
committed
Update tests
1 parent 3c17caf commit 80cc500

File tree

63 files changed

+721
-811
lines changed

Some content is hidden

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

63 files changed

+721
-811
lines changed

tests/mir-opt/uninhabited_enum_branching.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct Plop {
4949
fn simple() {
5050
// CHECK-LABEL: fn simple(
5151
// CHECK: [[discr:_.*]] = discriminant(
52-
// CHECK: switchInt(move [[discr]]) -> [0: [[unreachable:bb.*]], 1: [[unreachable]], 2: bb2, otherwise: [[unreachable]]];
52+
// CHECK: switchInt(move [[discr]]) -> [0: [[unreachable:bb.*]], 1: [[unreachable]], 2: bb1, otherwise: [[unreachable]]];
5353
// CHECK: [[unreachable]]: {
5454
// CHECK-NEXT: unreachable;
5555
match Test1::C {

tests/mir-opt/uninhabited_enum_branching.simple.UninhabitedEnumBranching.panic-unwind.diff

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,40 @@
1414
StorageLive(_2);
1515
_2 = Test1::C;
1616
_3 = discriminant(_2);
17-
- switchInt(move _3) -> [0: bb3, 1: bb4, 2: bb2, otherwise: bb1];
18-
+ switchInt(move _3) -> [0: bb1, 1: bb1, 2: bb2, otherwise: bb1];
17+
- switchInt(move _3) -> [0: bb2, 1: bb3, otherwise: bb1];
18+
+ switchInt(move _3) -> [0: bb5, 1: bb5, 2: bb1, otherwise: bb5];
1919
}
2020

2121
bb1: {
22-
unreachable;
23-
}
24-
25-
bb2: {
2622
StorageLive(_5);
2723
_5 = const "C";
2824
_1 = &(*_5);
2925
StorageDead(_5);
30-
goto -> bb5;
26+
goto -> bb4;
3127
}
3228

33-
bb3: {
29+
bb2: {
3430
_1 = const "A(Empty)";
35-
goto -> bb5;
31+
goto -> bb4;
3632
}
3733

38-
bb4: {
34+
bb3: {
3935
StorageLive(_4);
4036
_4 = const "B(Empty)";
4137
_1 = &(*_4);
4238
StorageDead(_4);
43-
goto -> bb5;
39+
goto -> bb4;
4440
}
4541

46-
bb5: {
42+
bb4: {
4743
StorageDead(_2);
4844
StorageDead(_1);
4945
_0 = const ();
5046
return;
47+
+ }
48+
+
49+
+ bb5: {
50+
+ unreachable;
5151
}
5252
}
5353

tests/mir-opt/unreachable.as_match.UnreachablePropagation.panic-unwind.diff

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
let mut _2: isize;
88
let _3: Empty;
99
let mut _4: !;
10-
+ let mut _5: bool;
1110
scope 1 {
1211
debug _x => _3;
1312
}
@@ -18,25 +17,6 @@
1817
}
1918

2019
bb1: {
21-
_2 = discriminant(_1);
22-
- switchInt(move _2) -> [0: bb4, 1: bb3, otherwise: bb2];
23-
+ _5 = Eq(_2, const 0_isize);
24-
+ assume(move _5);
25-
+ goto -> bb4;
26-
}
27-
28-
bb2: {
29-
unreachable;
30-
}
31-
32-
bb3: {
33-
- StorageLive(_3);
34-
- _3 = move ((_1 as Some).0: Empty);
35-
- StorageLive(_4);
36-
unreachable;
37-
}
38-
39-
bb4: {
4020
_0 = const ();
4121
StorageDead(_1);
4222
return;

tests/mir-opt/unreachable.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn if_let() {
3535
_y = 42;
3636
}
3737

38-
match _x { }
38+
match _x {}
3939
}
4040
}
4141

@@ -45,18 +45,11 @@ fn as_match() {
4545
// CHECK: bb0: {
4646
// CHECK: {{_.*}} = empty()
4747
// CHECK: bb1: {
48-
// CHECK: [[eq:_.*]] = Eq({{.*}}, const 0_isize);
49-
// CHECK-NEXT: assume(move [[eq]]);
50-
// CHECK-NEXT: goto -> bb4;
51-
// CHECK: bb2: {
52-
// CHECK-NEXT: unreachable;
53-
// CHECK: bb3: {
54-
// CHECK-NEXT: unreachable;
55-
// CHECK: bb4: {
48+
// CHECK-NEXT: _0 = const ();
5649
// CHECK: return;
5750
match empty() {
5851
None => {}
59-
Some(_x) => match _x {}
52+
Some(_x) => match _x {},
6053
}
6154
}
6255

tests/ui/closures/2229_closure_analysis/run_pass/multivariant.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// Test precise capture of a multi-variant enum (when remaining variants are
22
// visibly uninhabited).
3-
//@ revisions: min_exhaustive_patterns exhaustive_patterns
3+
//@ revisions: normal exhaustive_patterns
44
//@ edition:2021
55
//@ run-pass
66
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
7-
#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
87
#![feature(never_type)]
98

109
pub fn main() {

tests/ui/codemap_tests/huge_multispan_highlight.svg

Lines changed: 1 addition & 1 deletion
Loading

tests/ui/consts/const-eval/write-to-uninhabited-enum-variant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@ run-pass
2-
2+
#![allow(unreachable_patterns)]
33
#![allow(dead_code)]
44

5-
enum Empty { }
5+
enum Empty {}
66
enum Test1 {
77
A(u8),
88
B(Empty),

tests/ui/enum-discriminant/issue-61696.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ run-pass
2+
#![allow(unreachable_patterns)]
23

34
pub enum Infallible {}
45

tests/ui/enum-discriminant/niche.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ run-pass
2+
#![allow(unreachable_patterns)]
23

34
//! Make sure that we read and write enum discriminants correctly for corner cases caused
45
//! by layout optimizations.

tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ fn foo() -> Result<u32, !> {
55
}
66

77
fn main() {
8-
let Ok(_x) = foo(); //~ ERROR refutable pattern in local binding
8+
let Ok(_x) = &foo(); //~ ERROR refutable pattern in local binding
99
}

0 commit comments

Comments
 (0)