Skip to content

Commit b6af6b5

Browse files
committed
Remove feature gate from tests
1 parent fc5c182 commit b6af6b5

33 files changed

+188
-78
lines changed

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

+1-2
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/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0004]: non-exhaustive patterns: type `&!` is non-empty
2-
--> $DIR/always-inhabited-union-ref.rs:25:11
2+
--> $DIR/always-inhabited-union-ref.rs:24:11
33
|
44
LL | match uninhab_ref() {
55
| ^^^^^^^^^^^^^
@@ -14,13 +14,13 @@ LL + }
1414
|
1515

1616
error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
17-
--> $DIR/always-inhabited-union-ref.rs:29:11
17+
--> $DIR/always-inhabited-union-ref.rs:28:11
1818
|
1919
LL | match uninhab_union() {
2020
| ^^^^^^^^^^^^^^^
2121
|
2222
note: `Foo` defined here
23-
--> $DIR/always-inhabited-union-ref.rs:12:11
23+
--> $DIR/always-inhabited-union-ref.rs:11:11
2424
|
2525
LL | pub union Foo {
2626
| ^^^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
error[E0004]: non-exhaustive patterns: type `&!` is non-empty
2+
--> $DIR/always-inhabited-union-ref.rs:24:11
3+
|
4+
LL | match uninhab_ref() {
5+
| ^^^^^^^^^^^^^
6+
|
7+
= note: the matched value is of type `&!`
8+
= note: references are always considered inhabited
9+
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
10+
|
11+
LL ~ match uninhab_ref() {
12+
LL + _ => todo!(),
13+
LL + }
14+
|
15+
16+
error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
17+
--> $DIR/always-inhabited-union-ref.rs:28:11
18+
|
19+
LL | match uninhab_union() {
20+
| ^^^^^^^^^^^^^^^
21+
|
22+
note: `Foo` defined here
23+
--> $DIR/always-inhabited-union-ref.rs:11:11
24+
|
25+
LL | pub union Foo {
26+
| ^^^
27+
= note: the matched value is of type `Foo`
28+
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
29+
|
30+
LL ~ match uninhab_union() {
31+
LL + _ => todo!(),
32+
LL + }
33+
|
34+
35+
error: aborting due to 2 previous errors
36+
37+
For more information about this error, try `rustc --explain E0004`.

tests/ui/pattern/usefulness/always-inhabited-union-ref.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
//@ revisions: min_exhaustive_patterns exhaustive_patterns
1+
//@ revisions: normal exhaustive_patterns
22

33
// The precise semantics of inhabitedness with respect to unions and references is currently
44
// undecided. This test file currently checks a conservative choice.
55

66
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
7-
#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
87
#![feature(never_type)]
98
#![allow(dead_code)]
109
#![allow(unreachable_code)]

tests/ui/pattern/usefulness/impl-trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(never_type)]
2-
#![feature(min_exhaustive_patterns)]
32
#![feature(type_alias_impl_trait)]
43
#![feature(non_exhaustive_omitted_patterns_lint)]
54
#![deny(unreachable_patterns)]

tests/ui/pattern/usefulness/impl-trait.stderr

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,93 @@
11
error: unreachable pattern
2-
--> $DIR/impl-trait.rs:17:13
2+
--> $DIR/impl-trait.rs:16:13
33
|
44
LL | _ => {}
55
| ^
66
|
77
note: the lint level is defined here
8-
--> $DIR/impl-trait.rs:5:9
8+
--> $DIR/impl-trait.rs:4:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

1313
error: unreachable pattern
14-
--> $DIR/impl-trait.rs:31:13
14+
--> $DIR/impl-trait.rs:30:13
1515
|
1616
LL | _ => {}
1717
| ^
1818

1919
error: unreachable pattern
20-
--> $DIR/impl-trait.rs:45:13
20+
--> $DIR/impl-trait.rs:44:13
2121
|
2222
LL | Some(_) => {}
2323
| ^^^^^^^
2424

2525
error: unreachable pattern
26-
--> $DIR/impl-trait.rs:49:13
26+
--> $DIR/impl-trait.rs:48:13
2727
|
2828
LL | _ => {}
2929
| ^
3030

3131
error: unreachable pattern
32-
--> $DIR/impl-trait.rs:59:13
32+
--> $DIR/impl-trait.rs:58:13
3333
|
3434
LL | Some(_) => {}
3535
| ^^^^^^^
3636

3737
error: unreachable pattern
38-
--> $DIR/impl-trait.rs:63:13
38+
--> $DIR/impl-trait.rs:62:13
3939
|
4040
LL | _ => {}
4141
| ^
4242

4343
error: unreachable pattern
44-
--> $DIR/impl-trait.rs:76:9
44+
--> $DIR/impl-trait.rs:75:9
4545
|
4646
LL | _ => {}
4747
| ^
4848

4949
error: unreachable pattern
50-
--> $DIR/impl-trait.rs:86:9
50+
--> $DIR/impl-trait.rs:85:9
5151
|
5252
LL | _ => {}
5353
| - matches any value
5454
LL | Some((a, b)) => {}
5555
| ^^^^^^^^^^^^ unreachable pattern
5656

5757
error: unreachable pattern
58-
--> $DIR/impl-trait.rs:94:13
58+
--> $DIR/impl-trait.rs:93:13
5959
|
6060
LL | _ => {}
6161
| ^
6262

6363
error: unreachable pattern
64-
--> $DIR/impl-trait.rs:105:9
64+
--> $DIR/impl-trait.rs:104:9
6565
|
6666
LL | Some((mut x, mut y)) => {
6767
| ^^^^^^^^^^^^^^^^^^^^
6868

6969
error: unreachable pattern
70-
--> $DIR/impl-trait.rs:124:13
70+
--> $DIR/impl-trait.rs:123:13
7171
|
7272
LL | _ => {}
7373
| - matches any value
7474
LL | Rec { n: 0, w: Some(Rec { n: 0, w: _ }) } => {}
7575
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable pattern
7676

7777
error: unreachable pattern
78-
--> $DIR/impl-trait.rs:138:13
78+
--> $DIR/impl-trait.rs:137:13
7979
|
8080
LL | _ => {}
8181
| ^
8282

8383
error: unreachable pattern
84-
--> $DIR/impl-trait.rs:151:13
84+
--> $DIR/impl-trait.rs:150:13
8585
|
8686
LL | _ => {}
8787
| ^
8888

8989
error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty
90-
--> $DIR/impl-trait.rs:23:11
90+
--> $DIR/impl-trait.rs:22:11
9191
|
9292
LL | match return_never_rpit(x) {}
9393
| ^^^^^^^^^^^^^^^^^^^^
@@ -101,7 +101,7 @@ LL + }
101101
|
102102

103103
error[E0004]: non-exhaustive patterns: type `T` is non-empty
104-
--> $DIR/impl-trait.rs:37:11
104+
--> $DIR/impl-trait.rs:36:11
105105
|
106106
LL | match return_never_tait(x) {}
107107
| ^^^^^^^^^^^^^^^^^^^^

tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered
2-
--> $DIR/match-privately-empty.rs:15:11
2+
--> $DIR/match-privately-empty.rs:14:11
33
|
44
LL | match private::DATA {
55
| ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered
2+
--> $DIR/match-privately-empty.rs:14:11
3+
|
4+
LL | match private::DATA {
5+
| ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered
6+
|
7+
note: `Option<Private>` defined here
8+
--> $SRC_DIR/core/src/option.rs:LL:COL
9+
::: $SRC_DIR/core/src/option.rs:LL:COL
10+
|
11+
= note: not covered
12+
= note: the matched value is of type `Option<Private>`
13+
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
14+
|
15+
LL ~ Some(private::Private { misc: false, .. }) => {},
16+
LL + Some(Private { misc: true, .. }) => todo!()
17+
|
18+
19+
error: aborting due to 1 previous error
20+
21+
For more information about this error, try `rustc --explain E0004`.

tests/ui/pattern/usefulness/match-privately-empty.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
//@ revisions: min_exhaustive_patterns exhaustive_patterns
1+
//@ revisions: normal exhaustive_patterns
22
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
3-
#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
43
#![feature(never_type)]
54

65
mod private {

tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0004]: non-exhaustive patterns: `&[]` not covered
2-
--> $DIR/slice_of_empty.rs:21:11
2+
--> $DIR/slice_of_empty.rs:20:11
33
|
44
LL | match nevers {
55
| ^^^^^^ pattern `&[]` not covered
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
2+
--> $DIR/slice_of_empty.rs:9:11
3+
|
4+
LL | match nevers {
5+
| ^^^^^^ pattern `&[_, ..]` not covered
6+
|
7+
= note: the matched value is of type `&[!]`
8+
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
9+
|
10+
LL ~ &[] => (),
11+
LL ~ &[_, ..] => todo!(),
12+
|
13+
14+
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
15+
--> $DIR/slice_of_empty.rs:20:11
16+
|
17+
LL | match nevers {
18+
| ^^^^^^ patterns `&[]` and `&[_, _, ..]` not covered
19+
|
20+
= note: the matched value is of type `&[!]`
21+
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
22+
|
23+
LL ~ &[_] => (),
24+
LL ~ &[] | &[_, _, ..] => todo!(),
25+
|
26+
27+
error: aborting due to 2 previous errors
28+
29+
For more information about this error, try `rustc --explain E0004`.
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
//@ revisions: min_exhaustive_patterns exhaustive_patterns
1+
//@ revisions: normal exhaustive_patterns
22
#![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))]
3-
#![cfg_attr(min_exhaustive_patterns, feature(min_exhaustive_patterns))]
43
#![feature(never_type)]
54
#![deny(unreachable_patterns)]
65

76
fn main() {}
87

98
fn foo(nevers: &[!]) {
109
match nevers {
11-
//[min_exhaustive_patterns]~^ ERROR non-exhaustive patterns: `&[_, ..]` not covered
10+
//[normal]~^ ERROR non-exhaustive patterns: `&[_, ..]` not covered
1211
&[] => (),
1312
};
1413

@@ -20,7 +19,7 @@ fn foo(nevers: &[!]) {
2019

2120
match nevers {
2221
//[exhaustive_patterns]~^ ERROR non-exhaustive patterns: `&[]` not covered
23-
//[min_exhaustive_patterns]~^^ ERROR non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
22+
//[normal]~^^ ERROR non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered
2423
&[_] => (),
2524
};
2625
}

tests/ui/pattern/usefulness/uninhabited.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// `Ty::is_inhabited_from` function.
66
#![feature(never_type)]
77
#![feature(never_type_fallback)]
8-
#![feature(min_exhaustive_patterns)]
98
#![deny(unreachable_patterns)]
109

1110
macro_rules! assert_empty {

tests/ui/reachable/unreachable-loop-patterns.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#![feature(never_type, never_type_fallback)]
2-
#![feature(min_exhaustive_patterns)]
3-
42
#![allow(unreachable_code)]
53
#![deny(unreachable_patterns)]
64

tests/ui/reachable/unreachable-loop-patterns.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: unreachable pattern
2-
--> $DIR/unreachable-loop-patterns.rs:18:9
2+
--> $DIR/unreachable-loop-patterns.rs:16:9
33
|
44
LL | for _ in unimplemented!() as Void {}
55
| ^
66
|
77
note: the lint level is defined here
8-
--> $DIR/unreachable-loop-patterns.rs:5:9
8+
--> $DIR/unreachable-loop-patterns.rs:3:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)