mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
error[E0425]: cannot find value `x` in this scope
|
|
--> $DIR/while-let-typo.rs:4:16
|
|
|
|
|
LL | while Some(x) = foo {}
|
|
| ^ not found in this scope
|
|
|
|
|
help: you might have meant to use pattern matching
|
|
|
|
|
LL | while let Some(x) = foo {}
|
|
| +++
|
|
|
|
error[E0425]: cannot find value `x` in this scope
|
|
--> $DIR/while-let-typo.rs:8:11
|
|
|
|
|
LL | while x = 5 {}
|
|
| ^ not found in this scope
|
|
|
|
|
help: you might have meant to use pattern matching
|
|
|
|
|
LL | while let x = 5 {}
|
|
| +++
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/while-let-typo.rs:5:11
|
|
|
|
|
LL | while Some(foo) = bar {}
|
|
| ^^^^^^^^^^^^^^^ expected `bool`, found `()`
|
|
|
|
|
help: consider adding `let`
|
|
|
|
|
LL | while let Some(foo) = bar {}
|
|
| +++
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/while-let-typo.rs:6:11
|
|
|
|
|
LL | while 3 = foo {}
|
|
| ^^^^^^^ expected `bool`, found `()`
|
|
|
|
error[E0070]: invalid left-hand side of assignment
|
|
--> $DIR/while-let-typo.rs:7:19
|
|
|
|
|
LL | while Some(3) = foo {}
|
|
| - ^
|
|
| |
|
|
| cannot assign to this expression
|
|
|
|
|
help: you might have meant to use pattern destructuring
|
|
|
|
|
LL | while let Some(3) = foo {}
|
|
| +++
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
Some errors have detailed explanations: E0070, E0308, E0425.
|
|
For more information about an error, try `rustc --explain E0070`.
|