diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-11-29 12:34:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-29 12:34:48 +0100 |
| commit | aab61d0b9a143d21a4290fd00521f08f7abea0c5 (patch) | |
| tree | e4fb9e54182cf5de0d88316746d35d4ae950b01a /tests/rustdoc-js-std/alias-2.js | |
| parent | c03f8917ee45255166916cdc8b9aa1f6f8a98fdc (diff) | |
| parent | 55e4e3e3932ef41353efd888ff96dfc96ec61bd3 (diff) | |
| download | rust-aab61d0b9a143d21a4290fd00521f08f7abea0c5.tar.gz rust-aab61d0b9a143d21a4290fd00521f08f7abea0c5.zip | |
Rollup merge of #118191 - estebank:let-chain-typo, r=compiler-errors
Suggest `let` or `==` on typo'd let-chain
When encountering a bare assignment in a let-chain, suggest turning the
assignment into a `let` expression or an equality check.
```
error: expected expression, found `let` statement
--> $DIR/bad-if-let-suggestion.rs:5:8
|
LL | if let x = 1 && i = 2 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
help: you might have meant to continue the let-chain
|
LL | if let x = 1 && let i = 2 {}
| +++
help: you might have meant to compare for equality
|
LL | if let x = 1 && i == 2 {}
| +
```
Diffstat (limited to 'tests/rustdoc-js-std/alias-2.js')
0 files changed, 0 insertions, 0 deletions
