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
Rollup merge of #143276 - folkertdev:loop-match-opaque-pattern, r=Nadrieril
loop match: handle opaque patterns
tracking issue #132306fixes#143203
I believe the `Opaque` comes up because the range pattern is invalid? Because we do handle float patterns already so those should be fine.
r? `@Nadrieril`
Copy file name to clipboardExpand all lines: tests/ui/loop-match/invalid.stderr
+32-2Lines changed: 32 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -86,6 +86,36 @@ error: match arms that are part of a `#[loop_match]` cannot have guards
86
86
LL | State::B if cond => break 'a,
87
87
| ^^^^
88
88
89
-
error: aborting due to 12 previous errors
89
+
error[E0004]: non-exhaustive patterns: `State::B` and `State::C` not covered
90
+
--> $DIR/invalid.rs:168:19
91
+
|
92
+
LL | match state {
93
+
| ^^^^^ patterns `State::B` and `State::C` not covered
94
+
|
95
+
note: `State` defined here
96
+
--> $DIR/invalid.rs:7:6
97
+
|
98
+
LL | enum State {
99
+
| ^^^^^
100
+
LL | A,
101
+
LL | B,
102
+
| - not covered
103
+
LL | C,
104
+
| - not covered
105
+
= note: the matched value is of type `State`
106
+
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
107
+
|
108
+
LL ~ State::A => State::B,
109
+
LL ~ State::B | State::C => todo!(),
110
+
|
111
+
112
+
error[E0579]: lower range bound must be less than upper
113
+
--> $DIR/invalid.rs:185:17
114
+
|
115
+
LL | 4.0..3.0 => {
116
+
| ^^^^^^^^
117
+
118
+
error: aborting due to 14 previous errors
90
119
91
-
For more information about this error, try `rustc --explain E0308`.
120
+
Some errors have detailed explanations: E0004, E0308, E0579.
121
+
For more information about an error, try `rustc --explain E0004`.
0 commit comments