You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0004]: non-exhaustive patterns: `_` not covered
13
+
error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
14
14
--> $DIR/match-non-exhaustive.rs:3:11
15
15
|
16
16
LL | match 0 { 0 if false => () }
17
-
| ^ pattern `_` not covered
17
+
| ^ patterns `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
18
18
|
19
19
= note: the matched value is of type `i32`
20
20
= note: match arms with guards don't count towards exhaustivity
21
-
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
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
22
|
23
-
LL | match 0 { 0 if false => (), _ => todo!() }
24
-
| ++++++++++++++
23
+
LL | match 0 { 0 if false => (), i32::MIN..=-1_i32 | 1_i32..=i32::MAX => todo!() }
Copy file name to clipboardExpand all lines: tests/ui/pattern/usefulness/slice-patterns-exhaustiveness.stderr
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -89,18 +89,18 @@ LL ~ [] => {},
89
89
LL + &[_, ..] => todo!()
90
90
|
91
91
92
-
error[E0004]: non-exhaustive patterns: `&_` not covered
92
+
error[E0004]: non-exhaustive patterns: `&[]` and `&[_, ..]` not covered
93
93
--> $DIR/slice-patterns-exhaustiveness.rs:46:11
94
94
|
95
95
LL | match s {
96
-
| ^ pattern `&_` not covered
96
+
| ^ patterns `&[]` and `&[_, ..]` not covered
97
97
|
98
98
= note: the matched value is of type `&[bool]`
99
99
= note: match arms with guards don't count towards exhaustivity
100
-
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
100
+
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
101
101
|
102
102
LL ~ [..] if false => {},
103
-
LL + &_ => todo!()
103
+
LL + &[] | &[_, ..] => todo!()
104
104
|
105
105
106
106
error[E0004]: non-exhaustive patterns: `&[_, _, ..]` not covered
0 commit comments