2020-08-26 03:28:25 +00:00
|
|
|
error[E0425]: cannot find value `x` in this scope
|
|
|
|
--> $DIR/if-let-typo.rs:4:13
|
|
|
|
|
|
|
|
|
LL | if Some(x) = foo {}
|
|
|
|
| ^ not found in this scope
|
|
|
|
|
|
|
|
|
help: you might have meant to use pattern matching
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = foo {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2020-08-26 03:28:25 +00:00
|
|
|
|
2021-08-27 23:28:22 +00:00
|
|
|
error[E0425]: cannot find value `x` in this scope
|
2021-11-03 06:50:57 +00:00
|
|
|
--> $DIR/if-let-typo.rs:10:8
|
2021-08-27 23:28:22 +00:00
|
|
|
|
|
|
|
|
LL | if x = 5 {}
|
|
|
|
| ^ not found in this scope
|
|
|
|
|
|
|
|
|
help: you might have meant to use pattern matching
|
|
|
|
|
|
|
|
|
LL | if let x = 5 {}
|
|
|
|
| +++
|
|
|
|
|
2020-11-07 14:28:55 +00:00
|
|
|
error[E0308]: mismatched types
|
|
|
|
--> $DIR/if-let-typo.rs:4:8
|
|
|
|
|
|
|
|
|
LL | if Some(x) = foo {}
|
|
|
|
| ^^^^^^^^^^^^^ expected `bool`, found `()`
|
2022-10-27 06:43:15 +00:00
|
|
|
|
|
|
|
|
help: consider adding `let`
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = foo {}
|
|
|
|
| +++
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2021-11-03 06:50:57 +00:00
|
|
|
--> $DIR/if-let-typo.rs:6:8
|
2020-08-26 03:28:25 +00:00
|
|
|
|
|
2020-11-07 14:28:55 +00:00
|
|
|
LL | if Some(foo) = bar {}
|
|
|
|
| ^^^^^^^^^^^^^^^ expected `bool`, found `()`
|
2022-10-27 06:43:15 +00:00
|
|
|
|
|
|
|
|
help: consider adding `let`
|
|
|
|
|
|
|
|
|
LL | if let Some(foo) = bar {}
|
|
|
|
| +++
|
2020-08-26 03:28:25 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2021-11-03 06:50:57 +00:00
|
|
|
--> $DIR/if-let-typo.rs:7:8
|
2020-08-26 03:28:25 +00:00
|
|
|
|
|
|
|
|
LL | if 3 = foo {}
|
|
|
|
| ^^^^^^^ expected `bool`, found `()`
|
|
|
|
|
2020-11-07 14:28:55 +00:00
|
|
|
error[E0070]: invalid left-hand side of assignment
|
2021-11-03 06:50:57 +00:00
|
|
|
--> $DIR/if-let-typo.rs:8:16
|
2020-11-07 14:28:55 +00:00
|
|
|
|
|
|
|
|
LL | if Some(3) = foo {}
|
|
|
|
| - ^
|
|
|
|
| |
|
|
|
|
| cannot assign to this expression
|
|
|
|
|
2020-08-26 03:28:25 +00:00
|
|
|
error[E0308]: mismatched types
|
2021-11-03 06:50:57 +00:00
|
|
|
--> $DIR/if-let-typo.rs:8:8
|
2020-08-26 03:28:25 +00:00
|
|
|
|
|
|
|
|
LL | if Some(3) = foo {}
|
|
|
|
| ^^^^^^^^^^^^^ expected `bool`, found `()`
|
2022-10-27 06:43:15 +00:00
|
|
|
|
|
|
|
|
help: consider adding `let`
|
|
|
|
|
|
|
|
|
LL | if let Some(3) = foo {}
|
|
|
|
| +++
|
2020-08-26 03:28:25 +00:00
|
|
|
|
2021-11-03 06:50:57 +00:00
|
|
|
error: aborting due to 7 previous errors
|
2020-08-26 03:28:25 +00:00
|
|
|
|
2021-11-03 06:50:57 +00:00
|
|
|
Some errors have detailed explanations: E0070, E0308, E0425.
|
2020-11-07 14:28:55 +00:00
|
|
|
For more information about an error, try `rustc --explain E0070`.
|