Fix incorrect let to const suggestion for pattern bindings#152834
Fix incorrect let to const suggestion for pattern bindings#152834rust-bors[bot] merged 2 commits intorust-lang:mainfrom
let to const suggestion for pattern bindings#152834Conversation
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
cebca33 to
ccc0407
Compare
|
Friendly ping @jackh726 |
|
Reminder, once the PR becomes ready for a review, use |
ccc0407 to
8c83008
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8c83008 to
8fd10ec
Compare
|
@rustbot ready |
8fd10ec to
90c03d8
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Moved tests to |
|
@bors r+ rollup |
…uwer Rollup of 5 pull requests Successful merges: - #155546 (Improve E0308 error message for `impl Trait` return mismatches) - #152834 (Fix incorrect `let` to `const` suggestion for pattern bindings) - #155425 (Remove duplicated `Flags` methods.) - #155547 (Use per-parent disambiguators everywhere) - #155590 (Remove AttributeLintKind variants - part 5)
View all comments
When a variable from a pattern binding was referenced inside a
const {}block, the compiler incorrectly suggested replacingletwithconst. This was reported in #152831 forif let, but also applies towhile letandlet ... else.