rust/tests/ui/expr/if
Esteban Küber 55e4e3e393 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 {}
   |                        +
```
2023-11-28 18:07:52 +00:00
..
attrs
bad-if-let-suggestion.rs
bad-if-let-suggestion.stderr
expr-if-panic-fn.rs
expr-if-panic-pass.rs
expr-if-panic.rs
expr-if.rs
if-branch-types.rs
if-branch-types.stderr
if-check-panic.rs
if-check.rs
if-cond-bot.rs
if-else-type-mismatch.rs
if-else-type-mismatch.stderr
if-let-arm-types.rs
if-let-arm-types.stderr
if-let.rs
if-let.stderr
if-loop.rs
if-no-match-bindings.rs
if-no-match-bindings.stderr
if-ret.rs
if-ret.stderr
if-typeck.rs
if-typeck.stderr
if-without-block.rs
if-without-block.stderr
if-without-else-as-fn-expr.rs
if-without-else-as-fn-expr.stderr
if-without-else-result.rs
if-without-else-result.stderr
issue-4201.rs
issue-4201.stderr