mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
55e4e3e393
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 {} | + ``` |
||
---|---|---|
.. | ||
ast-lowering-does-not-wrap-let-chains.rs | ||
ast-pretty-check.rs | ||
ast-pretty-check.stdout | ||
ast-validate-guards.rs | ||
ast-validate-guards.stderr | ||
avoid-invalid-mir.rs | ||
avoid-invalid-mir.stderr | ||
chains-without-let.rs | ||
disallowed-positions-without-feature-gate.rs | ||
disallowed-positions-without-feature-gate.stderr | ||
disallowed-positions.rs | ||
disallowed-positions.stderr | ||
ensure-that-let-else-does-not-interact-with-let-chains.rs | ||
ensure-that-let-else-does-not-interact-with-let-chains.stderr | ||
feature-gate.rs | ||
feature-gate.stderr | ||
invalid-let-in-a-valid-let-context.rs | ||
invalid-let-in-a-valid-let-context.stderr | ||
irrefutable-lets.disallowed.stderr | ||
irrefutable-lets.rs | ||
issue-88498.rs | ||
issue-90722.rs | ||
issue-92145.rs | ||
issue-93150.rs | ||
issue-93150.stderr | ||
issue-99938.rs | ||
no-double-assigments.rs | ||
protect-precedences.rs | ||
protect-precedences.stderr | ||
then-else-blocks.rs |