diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-08-18 16:52:02 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-08-20 18:26:04 +0000 |
| commit | d216ca0506d6a70ca70fc29974ed9155beaabf7a (patch) | |
| tree | e05e43c90e445f9fefeffcee83e0445963cb1c6f /compiler/rustc_parse/src/errors.rs | |
| parent | c018ae5389c49cc4bcb8343d80dd8e7323325410 (diff) | |
| download | rust-d216ca0506d6a70ca70fc29974ed9155beaabf7a.tar.gz rust-d216ca0506d6a70ca70fc29974ed9155beaabf7a.zip | |
Detect missing `if let` or `let-else`
During `let` binding parse error and encountering a block, detect if there is a likely missing `if` or `else`:
```
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{`
--> $DIR/missing-if-let-or-let-else.rs:14:25
|
LL | let Some(x) = foo() {
| ^ expected one of `.`, `;`, `?`, `else`, or an operator
|
help: you might have meant to use `if let`
|
LL | if let Some(x) = foo() {
| ++
help: alternatively, you might have meant to use `let else`
|
LL | let Some(x) = foo() else {
| ++++
```
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
