Skip to content

Commit 425e494

Browse files
committed
Remove or_patterns from INCOMPLETE_FEATURES
1 parent 13db650 commit 425e494

27 files changed

+154
-248
lines changed

src/librustc_feature/active.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ pub const INCOMPLETE_FEATURES: &[Symbol] = &[
556556
sym::impl_trait_in_bindings,
557557
sym::generic_associated_types,
558558
sym::const_generics,
559-
sym::or_patterns,
560559
sym::let_chains,
561560
sym::raw_dylib,
562561
sym::const_trait_impl,

src/test/ui/lint/issue-54538-unused-parens-lint.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(box_patterns, stmt_expr_attributes)]
22

33
#![feature(or_patterns)]
4-
//~^ WARN the feature `or_patterns` is incomplete
54

65
#![allow(ellipsis_inclusive_range_patterns)]
76
#![allow(unreachable_patterns)]

src/test/ui/lint/issue-54538-unused-parens-lint.stderr

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,149 @@
1-
warning: the feature `or_patterns` is incomplete and may cause the compiler to crash
2-
--> $DIR/issue-54538-unused-parens-lint.rs:3:12
3-
|
4-
LL | #![feature(or_patterns)]
5-
| ^^^^^^^^^^^
6-
|
7-
= note: `#[warn(incomplete_features)]` on by default
8-
91
error: unnecessary parentheses around pattern
10-
--> $DIR/issue-54538-unused-parens-lint.rs:12:9
2+
--> $DIR/issue-54538-unused-parens-lint.rs:11:9
113
|
124
LL | let (a) = 0;
135
| ^^^ help: remove these parentheses
146
|
157
note: the lint level is defined here
16-
--> $DIR/issue-54538-unused-parens-lint.rs:9:9
8+
--> $DIR/issue-54538-unused-parens-lint.rs:8:9
179
|
1810
LL | #![deny(unused_parens)]
1911
| ^^^^^^^^^^^^^
2012

2113
error: unnecessary parentheses around pattern
22-
--> $DIR/issue-54538-unused-parens-lint.rs:13:9
14+
--> $DIR/issue-54538-unused-parens-lint.rs:12:9
2315
|
2416
LL | for (a) in 0..1 {}
2517
| ^^^ help: remove these parentheses
2618

2719
error: unnecessary parentheses around pattern
28-
--> $DIR/issue-54538-unused-parens-lint.rs:14:12
20+
--> $DIR/issue-54538-unused-parens-lint.rs:13:12
2921
|
3022
LL | if let (a) = 0 {}
3123
| ^^^ help: remove these parentheses
3224

3325
error: unnecessary parentheses around pattern
34-
--> $DIR/issue-54538-unused-parens-lint.rs:15:15
26+
--> $DIR/issue-54538-unused-parens-lint.rs:14:15
3527
|
3628
LL | while let (a) = 0 {}
3729
| ^^^ help: remove these parentheses
3830

3931
error: unnecessary parentheses around pattern
40-
--> $DIR/issue-54538-unused-parens-lint.rs:16:12
32+
--> $DIR/issue-54538-unused-parens-lint.rs:15:12
4133
|
4234
LL | fn foo((a): u8) {}
4335
| ^^^ help: remove these parentheses
4436

4537
error: unnecessary parentheses around pattern
46-
--> $DIR/issue-54538-unused-parens-lint.rs:17:14
38+
--> $DIR/issue-54538-unused-parens-lint.rs:16:14
4739
|
4840
LL | let _ = |(a): u8| 0;
4941
| ^^^ help: remove these parentheses
5042

5143
error: unnecessary parentheses around pattern
52-
--> $DIR/issue-54538-unused-parens-lint.rs:45:12
44+
--> $DIR/issue-54538-unused-parens-lint.rs:44:12
5345
|
5446
LL | if let (0 | 1) = 0 {}
5547
| ^^^^^^^ help: remove these parentheses
5648

5749
error: unnecessary parentheses around pattern
58-
--> $DIR/issue-54538-unused-parens-lint.rs:46:13
50+
--> $DIR/issue-54538-unused-parens-lint.rs:45:13
5951
|
6052
LL | if let ((0 | 1),) = (0,) {}
6153
| ^^^^^^^ help: remove these parentheses
6254

6355
error: unnecessary parentheses around pattern
64-
--> $DIR/issue-54538-unused-parens-lint.rs:47:13
56+
--> $DIR/issue-54538-unused-parens-lint.rs:46:13
6557
|
6658
LL | if let [(0 | 1)] = [0] {}
6759
| ^^^^^^^ help: remove these parentheses
6860

6961
error: unnecessary parentheses around pattern
70-
--> $DIR/issue-54538-unused-parens-lint.rs:48:16
62+
--> $DIR/issue-54538-unused-parens-lint.rs:47:16
7163
|
7264
LL | if let 0 | (1 | 2) = 0 {}
7365
| ^^^^^^^ help: remove these parentheses
7466

7567
error: unnecessary parentheses around pattern
76-
--> $DIR/issue-54538-unused-parens-lint.rs:50:15
68+
--> $DIR/issue-54538-unused-parens-lint.rs:49:15
7769
|
7870
LL | if let TS((0 | 1)) = TS(0) {}
7971
| ^^^^^^^ help: remove these parentheses
8072

8173
error: unnecessary parentheses around pattern
82-
--> $DIR/issue-54538-unused-parens-lint.rs:52:20
74+
--> $DIR/issue-54538-unused-parens-lint.rs:51:20
8375
|
8476
LL | if let NS { f: (0 | 1) } = (NS { f: 0 }) {}
8577
| ^^^^^^^ help: remove these parentheses
8678

8779
error: unnecessary parentheses around pattern
88-
--> $DIR/issue-54538-unused-parens-lint.rs:62:9
80+
--> $DIR/issue-54538-unused-parens-lint.rs:61:9
8981
|
9082
LL | (_) => {}
9183
| ^^^ help: remove these parentheses
9284

9385
error: unnecessary parentheses around pattern
94-
--> $DIR/issue-54538-unused-parens-lint.rs:63:9
86+
--> $DIR/issue-54538-unused-parens-lint.rs:62:9
9587
|
9688
LL | (y) => {}
9789
| ^^^ help: remove these parentheses
9890

9991
error: unnecessary parentheses around pattern
100-
--> $DIR/issue-54538-unused-parens-lint.rs:64:9
92+
--> $DIR/issue-54538-unused-parens-lint.rs:63:9
10193
|
10294
LL | (ref r) => {}
10395
| ^^^^^^^ help: remove these parentheses
10496

10597
error: unnecessary parentheses around pattern
106-
--> $DIR/issue-54538-unused-parens-lint.rs:65:9
98+
--> $DIR/issue-54538-unused-parens-lint.rs:64:9
10799
|
108100
LL | (e @ 1...2) => {}
109101
| ^^^^^^^^^^^ help: remove these parentheses
110102

111103
error: unnecessary parentheses around pattern
112-
--> $DIR/issue-54538-unused-parens-lint.rs:71:9
104+
--> $DIR/issue-54538-unused-parens-lint.rs:70:9
113105
|
114106
LL | (e @ &(1...2)) => {}
115107
| ^^^^^^^^^^^^^^ help: remove these parentheses
116108

117109
error: unnecessary parentheses around pattern
118-
--> $DIR/issue-54538-unused-parens-lint.rs:72:10
110+
--> $DIR/issue-54538-unused-parens-lint.rs:71:10
119111
|
120112
LL | &(_) => {}
121113
| ^^^ help: remove these parentheses
122114

123115
error: unnecessary parentheses around pattern
124-
--> $DIR/issue-54538-unused-parens-lint.rs:83:9
116+
--> $DIR/issue-54538-unused-parens-lint.rs:82:9
125117
|
126118
LL | (_) => {}
127119
| ^^^ help: remove these parentheses
128120

129121
error: unnecessary parentheses around pattern
130-
--> $DIR/issue-54538-unused-parens-lint.rs:84:9
122+
--> $DIR/issue-54538-unused-parens-lint.rs:83:9
131123
|
132124
LL | (y) => {}
133125
| ^^^ help: remove these parentheses
134126

135127
error: unnecessary parentheses around pattern
136-
--> $DIR/issue-54538-unused-parens-lint.rs:85:9
128+
--> $DIR/issue-54538-unused-parens-lint.rs:84:9
137129
|
138130
LL | (ref r) => {}
139131
| ^^^^^^^ help: remove these parentheses
140132

141133
error: unnecessary parentheses around pattern
142-
--> $DIR/issue-54538-unused-parens-lint.rs:86:9
134+
--> $DIR/issue-54538-unused-parens-lint.rs:85:9
143135
|
144136
LL | (e @ 1..=2) => {}
145137
| ^^^^^^^^^^^ help: remove these parentheses
146138

147139
error: unnecessary parentheses around pattern
148-
--> $DIR/issue-54538-unused-parens-lint.rs:92:9
140+
--> $DIR/issue-54538-unused-parens-lint.rs:91:9
149141
|
150142
LL | (e @ &(1..=2)) => {}
151143
| ^^^^^^^^^^^^^^ help: remove these parentheses
152144

153145
error: unnecessary parentheses around pattern
154-
--> $DIR/issue-54538-unused-parens-lint.rs:93:10
146+
--> $DIR/issue-54538-unused-parens-lint.rs:92:10
155147
|
156148
LL | &(_) => {}
157149
| ^^^ help: remove these parentheses

src/test/ui/or-patterns/already-bound-name.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// correctly accounts for or-patterns.
33

44
#![feature(or_patterns)]
5-
//~^ WARN the feature `or_patterns` is incomplete
65

76
enum E<T> { A(T, T), B(T) }
87

src/test/ui/or-patterns/already-bound-name.stderr

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,89 @@
11
error[E0416]: identifier `a` is bound more than once in the same pattern
2-
--> $DIR/already-bound-name.rs:12:13
2+
--> $DIR/already-bound-name.rs:11:13
33
|
44
LL | let (a, a) = (0, 1); // Standard duplication without an or-pattern.
55
| ^ used in a pattern more than once
66

77
error[E0416]: identifier `a` is bound more than once in the same pattern
8-
--> $DIR/already-bound-name.rs:15:15
8+
--> $DIR/already-bound-name.rs:14:15
99
|
1010
LL | let (a, A(a, _) | B(a)) = (0, A(1, 2));
1111
| ^ used in a pattern more than once
1212

1313
error[E0416]: identifier `a` is bound more than once in the same pattern
14-
--> $DIR/already-bound-name.rs:15:25
14+
--> $DIR/already-bound-name.rs:14:25
1515
|
1616
LL | let (a, A(a, _) | B(a)) = (0, A(1, 2));
1717
| ^ used in a pattern more than once
1818

1919
error[E0416]: identifier `a` is bound more than once in the same pattern
20-
--> $DIR/already-bound-name.rs:19:26
20+
--> $DIR/already-bound-name.rs:18:26
2121
|
2222
LL | let (A(a, _) | B(a), a) = (A(0, 1), 2);
2323
| ^ used in a pattern more than once
2424

2525
error[E0416]: identifier `a` is bound more than once in the same pattern
26-
--> $DIR/already-bound-name.rs:22:14
26+
--> $DIR/already-bound-name.rs:21:14
2727
|
2828
LL | let A(a, a) | B(a) = A(0, 1);
2929
| ^ used in a pattern more than once
3030

3131
error[E0416]: identifier `a` is bound more than once in the same pattern
32-
--> $DIR/already-bound-name.rs:25:21
32+
--> $DIR/already-bound-name.rs:24:21
3333
|
3434
LL | let B(a) | A(a, a) = A(0, 1);
3535
| ^ used in a pattern more than once
3636

3737
error[E0416]: identifier `a` is bound more than once in the same pattern
38-
--> $DIR/already-bound-name.rs:29:21
38+
--> $DIR/already-bound-name.rs:28:21
3939
|
4040
LL | B(a) | A(a, a) => {} // Let's ensure `match` has no funny business.
4141
| ^ used in a pattern more than once
4242

4343
error[E0416]: identifier `a` is bound more than once in the same pattern
44-
--> $DIR/already-bound-name.rs:33:36
44+
--> $DIR/already-bound-name.rs:32:36
4545
|
4646
LL | let B(A(a, _) | B(a)) | A(a, A(a, _) | B(a)) = B(B(1));
4747
| ^ used in a pattern more than once
4848

4949
error[E0416]: identifier `a` is bound more than once in the same pattern
50-
--> $DIR/already-bound-name.rs:33:46
50+
--> $DIR/already-bound-name.rs:32:46
5151
|
5252
LL | let B(A(a, _) | B(a)) | A(a, A(a, _) | B(a)) = B(B(1));
5353
| ^ used in a pattern more than once
5454

5555
error[E0416]: identifier `a` is bound more than once in the same pattern
56-
--> $DIR/already-bound-name.rs:38:36
56+
--> $DIR/already-bound-name.rs:37:36
5757
|
5858
LL | let B(_) | A(A(a, _) | B(a), A(a, _) | B(a)) = B(B(1));
5959
| ^ used in a pattern more than once
6060

6161
error[E0416]: identifier `a` is bound more than once in the same pattern
62-
--> $DIR/already-bound-name.rs:38:46
62+
--> $DIR/already-bound-name.rs:37:46
6363
|
6464
LL | let B(_) | A(A(a, _) | B(a), A(a, _) | B(a)) = B(B(1));
6565
| ^ used in a pattern more than once
6666

6767
error[E0408]: variable `a` is not bound in all patterns
68-
--> $DIR/already-bound-name.rs:38:9
68+
--> $DIR/already-bound-name.rs:37:9
6969
|
7070
LL | let B(_) | A(A(a, _) | B(a), A(a, _) | B(a)) = B(B(1));
7171
| ^^^^ pattern doesn't bind `a` - variable not in all patterns
7272

7373
error[E0416]: identifier `a` is bound more than once in the same pattern
74-
--> $DIR/already-bound-name.rs:43:49
74+
--> $DIR/already-bound-name.rs:42:49
7575
|
7676
LL | let B(A(a, _) | B(a)) | A(A(a, _) | B(a), A(a, _) | B(a)) = B(B(1));
7777
| ^ used in a pattern more than once
7878

7979
error[E0416]: identifier `a` is bound more than once in the same pattern
80-
--> $DIR/already-bound-name.rs:43:59
80+
--> $DIR/already-bound-name.rs:42:59
8181
|
8282
LL | let B(A(a, _) | B(a)) | A(A(a, _) | B(a), A(a, _) | B(a)) = B(B(1));
8383
| ^ used in a pattern more than once
8484

85-
warning: the feature `or_patterns` is incomplete and may cause the compiler to crash
86-
--> $DIR/already-bound-name.rs:4:12
87-
|
88-
LL | #![feature(or_patterns)]
89-
| ^^^^^^^^^^^
90-
|
91-
= note: `#[warn(incomplete_features)]` on by default
92-
9385
error[E0308]: mismatched types
94-
--> $DIR/already-bound-name.rs:33:31
86+
--> $DIR/already-bound-name.rs:32:31
9587
|
9688
LL | let B(A(a, _) | B(a)) | A(a, A(a, _) | B(a)) = B(B(1));
9789
| ^ ------- this expression has type `E<E<{integer}>>`

src/test/ui/or-patterns/consistent-bindings.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// edition:2018
44

55
#![feature(or_patterns)]
6-
//~^ WARN the feature `or_patterns` is incomplete
76

87
fn main() {
98
// One level:

src/test/ui/or-patterns/consistent-bindings.stderr

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
warning: the feature `or_patterns` is incomplete and may cause the compiler to crash
2-
--> $DIR/consistent-bindings.rs:5:12
3-
|
4-
LL | #![feature(or_patterns)]
5-
| ^^^^^^^^^^^
6-
|
7-
= note: `#[warn(incomplete_features)]` on by default
8-
91
error[E0308]: mismatched types
10-
--> $DIR/consistent-bindings.rs:44:9
2+
--> $DIR/consistent-bindings.rs:43:9
113
|
124
LL | let () = 0;
135
| ^^ expected integer, found `()`

src/test/ui/or-patterns/exhaustiveness-non-exhaustive.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
#![feature(or_patterns)]
2-
3-
#![allow(incomplete_features)]
42
#![deny(unreachable_patterns)]
53

64
// We wrap patterns in a tuple because top-level or-patterns are special-cased for now.
75
fn main() {
86
// Get the fatal error out of the way
97
match (0u8,) {
10-
(0 | _,) => {}
11-
//~^ ERROR or-patterns are not fully implemented yet
8+
(0 | _,) => {} //~^ ERROR or-patterns are not fully implemented yet
129
}
1310

1411
match (0u8, 0u8) {
@@ -17,7 +14,7 @@ fn main() {
1714
}
1815
match ((0u8,),) {
1916
//~^ ERROR non-exhaustive patterns: `((4u8..=std::u8::MAX))`
20-
((0 | 1,) | (2 | 3,),) => {},
17+
((0 | 1,) | (2 | 3,),) => {}
2118
}
2219
match (Some(0u8),) {
2320
//~^ ERROR non-exhaustive patterns: `(Some(2u8..=std::u8::MAX))`

0 commit comments

Comments
 (0)