@@ -173,7 +173,10 @@ error[E0308]: mismatched types
173173 |
174174LL | fn while_let_binding() -> bool {
175175 | ---- expected `bool` because of return type
176- LL | / while let x = false {
176+ LL | while let x = false {
177+ | ^ - this pattern always matches, consider using `loop` instead
178+ | _____|
179+ | |
177180LL | |
178181LL | | if x {
179182LL | | return true;
@@ -182,11 +185,6 @@ LL | | }
182185 | |_____^ expected `bool`, found `()`
183186 |
184187 = note: `while` loops evaluate to unit type `()`
185- note: this pattern always matches, consider using `loop` instead
186- --> $DIR/coerce-loop-issue-122561.rs:73:15
187- |
188- LL | while let x = false {
189- | ^
190188help: consider returning a value here
191189 |
192190LL ~ }
@@ -198,7 +196,10 @@ error[E0308]: mismatched types
198196 |
199197LL | fn while_let_tuple() -> bool {
200198 | ---- expected `bool` because of return type
201- LL | / while let (x, _) = (false, true) {
199+ LL | while let (x, _) = (false, true) {
200+ | ^ ------ this pattern always matches, consider using `loop` instead
201+ | _____|
202+ | |
202203LL | |
203204LL | | if x {
204205LL | | return true;
@@ -207,11 +208,6 @@ LL | | }
207208 | |_____^ expected `bool`, found `()`
208209 |
209210 = note: `while` loops evaluate to unit type `()`
210- note: this pattern always matches, consider using `loop` instead
211- --> $DIR/coerce-loop-issue-122561.rs:82:15
212- |
213- LL | while let (x, _) = (false, true) {
214- | ^^^^^^
215211help: consider returning a value here
216212 |
217213LL ~ }
0 commit comments