Skip to content

Commit 5687c16

Browse files
committed
overlapping_range_endpoints does not belong in the unused lint group
1 parent 94ad5e1 commit 5687c16

File tree

5 files changed

+39
-38
lines changed

5 files changed

+39
-38
lines changed

compiler/rustc_lint/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ fn register_builtins(store: &mut LintStore, no_interleave_lints: bool) {
283283
UNUSED_MUT,
284284
UNREACHABLE_CODE,
285285
UNREACHABLE_PATTERNS,
286-
OVERLAPPING_RANGE_ENDPOINTS,
287286
UNUSED_MUST_USE,
288287
UNUSED_UNSAFE,
289288
PATH_STATEMENTS,

src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![feature(exclusive_range_pattern)]
22
#![feature(assoc_char_consts)]
3+
#![allow(overlapping_range_endpoints)]
34
#![deny(unreachable_patterns)]
45

56
macro_rules! m {

src/test/ui/pattern/usefulness/integer-ranges/exhaustiveness.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
2-
--> $DIR/exhaustiveness.rs:47:8
2+
--> $DIR/exhaustiveness.rs:48:8
33
|
44
LL | m!(0u8, 0..255);
55
| ^^^ pattern `u8::MAX` not covered
@@ -8,7 +8,7 @@ LL | m!(0u8, 0..255);
88
= note: the matched value is of type `u8`
99

1010
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
11-
--> $DIR/exhaustiveness.rs:48:8
11+
--> $DIR/exhaustiveness.rs:49:8
1212
|
1313
LL | m!(0u8, 0..=254);
1414
| ^^^ pattern `u8::MAX` not covered
@@ -17,7 +17,7 @@ LL | m!(0u8, 0..=254);
1717
= note: the matched value is of type `u8`
1818

1919
error[E0004]: non-exhaustive patterns: `0_u8` not covered
20-
--> $DIR/exhaustiveness.rs:49:8
20+
--> $DIR/exhaustiveness.rs:50:8
2121
|
2222
LL | m!(0u8, 1..=255);
2323
| ^^^ pattern `0_u8` not covered
@@ -26,7 +26,7 @@ LL | m!(0u8, 1..=255);
2626
= note: the matched value is of type `u8`
2727

2828
error[E0004]: non-exhaustive patterns: `42_u8` not covered
29-
--> $DIR/exhaustiveness.rs:50:8
29+
--> $DIR/exhaustiveness.rs:51:8
3030
|
3131
LL | m!(0u8, 0..42 | 43..=255);
3232
| ^^^ pattern `42_u8` not covered
@@ -35,7 +35,7 @@ LL | m!(0u8, 0..42 | 43..=255);
3535
= note: the matched value is of type `u8`
3636

3737
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
38-
--> $DIR/exhaustiveness.rs:51:8
38+
--> $DIR/exhaustiveness.rs:52:8
3939
|
4040
LL | m!(0i8, -128..127);
4141
| ^^^ pattern `i8::MAX` not covered
@@ -44,7 +44,7 @@ LL | m!(0i8, -128..127);
4444
= note: the matched value is of type `i8`
4545

4646
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
47-
--> $DIR/exhaustiveness.rs:52:8
47+
--> $DIR/exhaustiveness.rs:53:8
4848
|
4949
LL | m!(0i8, -128..=126);
5050
| ^^^ pattern `i8::MAX` not covered
@@ -53,7 +53,7 @@ LL | m!(0i8, -128..=126);
5353
= note: the matched value is of type `i8`
5454

5555
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
56-
--> $DIR/exhaustiveness.rs:53:8
56+
--> $DIR/exhaustiveness.rs:54:8
5757
|
5858
LL | m!(0i8, -127..=127);
5959
| ^^^ pattern `i8::MIN` not covered
@@ -62,7 +62,7 @@ LL | m!(0i8, -127..=127);
6262
= note: the matched value is of type `i8`
6363

6464
error[E0004]: non-exhaustive patterns: `0_i8` not covered
65-
--> $DIR/exhaustiveness.rs:54:11
65+
--> $DIR/exhaustiveness.rs:55:11
6666
|
6767
LL | match 0i8 {
6868
| ^^^ pattern `0_i8` not covered
@@ -71,7 +71,7 @@ LL | match 0i8 {
7171
= note: the matched value is of type `i8`
7272

7373
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
74-
--> $DIR/exhaustiveness.rs:59:8
74+
--> $DIR/exhaustiveness.rs:60:8
7575
|
7676
LL | m!(0u128, 0..=ALMOST_MAX);
7777
| ^^^^^ pattern `u128::MAX` not covered
@@ -80,7 +80,7 @@ LL | m!(0u128, 0..=ALMOST_MAX);
8080
= note: the matched value is of type `u128`
8181

8282
error[E0004]: non-exhaustive patterns: `5_u128..=u128::MAX` not covered
83-
--> $DIR/exhaustiveness.rs:60:8
83+
--> $DIR/exhaustiveness.rs:61:8
8484
|
8585
LL | m!(0u128, 0..=4);
8686
| ^^^^^ pattern `5_u128..=u128::MAX` not covered
@@ -89,7 +89,7 @@ LL | m!(0u128, 0..=4);
8989
= note: the matched value is of type `u128`
9090

9191
error[E0004]: non-exhaustive patterns: `0_u128` not covered
92-
--> $DIR/exhaustiveness.rs:61:8
92+
--> $DIR/exhaustiveness.rs:62:8
9393
|
9494
LL | m!(0u128, 1..=u128::MAX);
9595
| ^^^^^ pattern `0_u128` not covered
@@ -98,7 +98,7 @@ LL | m!(0u128, 1..=u128::MAX);
9898
= note: the matched value is of type `u128`
9999

100100
error[E0004]: non-exhaustive patterns: `(126_u8..=127_u8, false)` not covered
101-
--> $DIR/exhaustiveness.rs:69:11
101+
--> $DIR/exhaustiveness.rs:70:11
102102
|
103103
LL | match (0u8, true) {
104104
| ^^^^^^^^^^^ pattern `(126_u8..=127_u8, false)` not covered

src/test/ui/pattern/usefulness/integer-ranges/reachability.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(exclusive_range_pattern)]
2+
#![allow(overlapping_range_endpoints)]
23
#![deny(unreachable_patterns)]
34

45
macro_rules! m {

src/test/ui/pattern/usefulness/integer-ranges/reachability.stderr

+25-25
Original file line numberDiff line numberDiff line change
@@ -1,149 +1,149 @@
11
error: unreachable pattern
2-
--> $DIR/reachability.rs:16:17
2+
--> $DIR/reachability.rs:17:17
33
|
44
LL | m!(0u8, 42, 42);
55
| ^^
66
|
77
note: the lint level is defined here
8-
--> $DIR/reachability.rs:2:9
8+
--> $DIR/reachability.rs:3:9
99
|
1010
LL | #![deny(unreachable_patterns)]
1111
| ^^^^^^^^^^^^^^^^^^^^
1212

1313
error: unreachable pattern
14-
--> $DIR/reachability.rs:20:22
14+
--> $DIR/reachability.rs:21:22
1515
|
1616
LL | m!(0u8, 20..=30, 20);
1717
| ^^
1818

1919
error: unreachable pattern
20-
--> $DIR/reachability.rs:21:22
20+
--> $DIR/reachability.rs:22:22
2121
|
2222
LL | m!(0u8, 20..=30, 21);
2323
| ^^
2424

2525
error: unreachable pattern
26-
--> $DIR/reachability.rs:22:22
26+
--> $DIR/reachability.rs:23:22
2727
|
2828
LL | m!(0u8, 20..=30, 25);
2929
| ^^
3030

3131
error: unreachable pattern
32-
--> $DIR/reachability.rs:23:22
32+
--> $DIR/reachability.rs:24:22
3333
|
3434
LL | m!(0u8, 20..=30, 29);
3535
| ^^
3636

3737
error: unreachable pattern
38-
--> $DIR/reachability.rs:24:22
38+
--> $DIR/reachability.rs:25:22
3939
|
4040
LL | m!(0u8, 20..=30, 30);
4141
| ^^
4242

4343
error: unreachable pattern
44-
--> $DIR/reachability.rs:27:21
44+
--> $DIR/reachability.rs:28:21
4545
|
4646
LL | m!(0u8, 20..30, 20);
4747
| ^^
4848

4949
error: unreachable pattern
50-
--> $DIR/reachability.rs:28:21
50+
--> $DIR/reachability.rs:29:21
5151
|
5252
LL | m!(0u8, 20..30, 21);
5353
| ^^
5454

5555
error: unreachable pattern
56-
--> $DIR/reachability.rs:29:21
56+
--> $DIR/reachability.rs:30:21
5757
|
5858
LL | m!(0u8, 20..30, 25);
5959
| ^^
6060

6161
error: unreachable pattern
62-
--> $DIR/reachability.rs:30:21
62+
--> $DIR/reachability.rs:31:21
6363
|
6464
LL | m!(0u8, 20..30, 29);
6565
| ^^
6666

6767
error: unreachable pattern
68-
--> $DIR/reachability.rs:34:22
68+
--> $DIR/reachability.rs:35:22
6969
|
7070
LL | m!(0u8, 20..=30, 20..=30);
7171
| ^^^^^^^
7272

7373
error: unreachable pattern
74-
--> $DIR/reachability.rs:35:22
74+
--> $DIR/reachability.rs:36:22
7575
|
7676
LL | m!(0u8, 20.. 30, 20.. 30);
7777
| ^^^^^^^
7878

7979
error: unreachable pattern
80-
--> $DIR/reachability.rs:36:22
80+
--> $DIR/reachability.rs:37:22
8181
|
8282
LL | m!(0u8, 20..=30, 20.. 30);
8383
| ^^^^^^^
8484

8585
error: unreachable pattern
86-
--> $DIR/reachability.rs:38:22
86+
--> $DIR/reachability.rs:39:22
8787
|
8888
LL | m!(0u8, 20..=30, 21..=30);
8989
| ^^^^^^^
9090

9191
error: unreachable pattern
92-
--> $DIR/reachability.rs:39:22
92+
--> $DIR/reachability.rs:40:22
9393
|
9494
LL | m!(0u8, 20..=30, 20..=29);
9595
| ^^^^^^^
9696

9797
error: unreachable pattern
98-
--> $DIR/reachability.rs:41:24
98+
--> $DIR/reachability.rs:42:24
9999
|
100100
LL | m!('a', 'A'..='z', 'a'..='z');
101101
| ^^^^^^^^^
102102

103103
error: unreachable pattern
104-
--> $DIR/reachability.rs:48:9
104+
--> $DIR/reachability.rs:49:9
105105
|
106106
LL | 5..=8 => {},
107107
| ^^^^^
108108

109109
error: unreachable pattern
110-
--> $DIR/reachability.rs:54:9
110+
--> $DIR/reachability.rs:55:9
111111
|
112112
LL | 5..15 => {},
113113
| ^^^^^
114114

115115
error: unreachable pattern
116-
--> $DIR/reachability.rs:61:9
116+
--> $DIR/reachability.rs:62:9
117117
|
118118
LL | 5..25 => {},
119119
| ^^^^^
120120

121121
error: unreachable pattern
122-
--> $DIR/reachability.rs:69:9
122+
--> $DIR/reachability.rs:70:9
123123
|
124124
LL | 5..25 => {},
125125
| ^^^^^
126126

127127
error: unreachable pattern
128-
--> $DIR/reachability.rs:75:9
128+
--> $DIR/reachability.rs:76:9
129129
|
130130
LL | 5..15 => {},
131131
| ^^^^^
132132

133133
error: unreachable pattern
134-
--> $DIR/reachability.rs:82:9
134+
--> $DIR/reachability.rs:83:9
135135
|
136136
LL | '\u{D7FF}'..='\u{E000}' => {},
137137
| ^^^^^^^^^^^^^^^^^^^^^^^
138138

139139
error: unreachable pattern
140-
--> $DIR/reachability.rs:103:9
140+
--> $DIR/reachability.rs:104:9
141141
|
142142
LL | &FOO => {}
143143
| ^^^^
144144

145145
error: unreachable pattern
146-
--> $DIR/reachability.rs:104:9
146+
--> $DIR/reachability.rs:105:9
147147
|
148148
LL | BAR => {}
149149
| ^^^

0 commit comments

Comments
 (0)