rust/tests/ui/rfcs/rfc-2497-if-let-chains
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
..
ast-lowering-does-not-wrap-let-chains.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
ast-pretty-check.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
ast-pretty-check.stdout Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
ast-validate-guards.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
ast-validate-guards.stderr Address review comments 2023-09-13 15:00:31 +00:00
avoid-invalid-mir.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
avoid-invalid-mir.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
chains-without-let.rs lower bare boolean expression with if-construct 2023-08-30 17:24:11 +08:00
disallowed-positions-without-feature-gate.rs Reduce double errors for invalid let expressions 2023-09-11 16:17:06 +00:00
disallowed-positions-without-feature-gate.stderr Address review comments 2023-09-13 15:00:31 +00:00
disallowed-positions.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
disallowed-positions.stderr Address review comments 2023-09-13 15:00:31 +00:00
ensure-that-let-else-does-not-interact-with-let-chains.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
ensure-that-let-else-does-not-interact-with-let-chains.stderr Address review comments 2023-09-13 15:00:31 +00:00
feature-gate.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
feature-gate.stderr Address review comments 2023-09-13 15:00:31 +00:00
invalid-let-in-a-valid-let-context.rs Move let expression checking to parsing 2023-09-11 15:51:18 +00:00
invalid-let-in-a-valid-let-context.stderr Suggest let or == on typo'd let-chain 2023-11-28 18:07:52 +00:00
irrefutable-lets.disallowed.stderr Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
irrefutable-lets.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
issue-88498.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
issue-90722.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
issue-92145.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
issue-93150.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
issue-93150.stderr Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
issue-99938.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
no-double-assigments.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
protect-precedences.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
protect-precedences.stderr Better group RFC ui tests together 2023-06-05 16:09:46 +00:00
then-else-blocks.rs Better group RFC ui tests together 2023-06-05 16:09:46 +00:00