Fix diagnostics for non-exhaustive destructuring assignments (#157553)#157578
Merged
Conversation
Collaborator
|
Some changes occurred in match checking cc @Nadrieril |
Collaborator
|
r? @adwinwhite rustbot has assigned @adwinwhite. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
6f6faa7 to
74a806a
Compare
This comment has been minimized.
This comment has been minimized.
Nadrieril
reviewed
Jun 7, 2026
Member
|
Hi, thanks for your PR! You'll have to run |
74a806a to
afbfbf4
Compare
afbfbf4 to
b791fd7
Compare
Member
|
Yep, LGTM. Thank you! @bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 8, 2026
…=Nadrieril Fix diagnostics for non-exhaustive destructuring assignments (rust-lang#157553) Assigning to a refutable pattern (e.g. `Foo::One = Foo::One;`) is a destructuring assignment, which is lowered to a `let` binding. When the pattern was refutable, the refutability check reported it as a `let` binding. This detects the `AssignDesugar` origin during match checking and reports it as an assignment instead, dropping the `let`-specific note and suggestion. Fixes rust-lang#157553.
This was referenced Jun 8, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 8, 2026
…uwer Rollup of 13 pull requests Successful merges: - #147302 (asm! support for the Xtensa architecture) - #148820 (Add very basic "comptime" fn implementation) - #157299 (Fix unstable diagnostics in tests) - #143511 (Improve TLS codegen by marking the panic/init path as cold) - #154608 (Add `_value` API for number literals in proc-macro) - #156762 (xfs support in `test_rename_directory_to_non_empty_directory`) - #157300 (Relax test requirements for consistency) - #157383 (tests: codegen-llvm: Ignore BPF targets in c-variadic-opt) - #157413 (fix: don't suggest .into_iter() for .cloned()/.copied() on non-reference Option) - #157578 (Fix diagnostics for non-exhaustive destructuring assignments (#157553)) - #157587 (explain that the size_of constant also serves to avoid optimizing away 'unused' size_of calls) - #157596 (test: remove ineffective link-extern-crate-with-drop-type test) - #157602 (rustdoc: Remove unnecessary fast path)
rust-timer
added a commit
that referenced
this pull request
Jun 8, 2026
Rollup merge of #157578 - MaximilianAzendorf:issue-157553, r=Nadrieril Fix diagnostics for non-exhaustive destructuring assignments (#157553) Assigning to a refutable pattern (e.g. `Foo::One = Foo::One;`) is a destructuring assignment, which is lowered to a `let` binding. When the pattern was refutable, the refutability check reported it as a `let` binding. This detects the `AssignDesugar` origin during match checking and reports it as an assignment instead, dropping the `let`-specific note and suggestion. Fixes #157553.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assigning to a refutable pattern (e.g.
Foo::One = Foo::One;) is a destructuring assignment, which is lowered to aletbinding. When the pattern was refutable, the refutability check reported it as aletbinding. This detects theAssignDesugarorigin during match checking and reports it as an assignment instead, dropping thelet-specific note and suggestion.Fixes #157553.