Skip to content

In rustc_pattern_analysis, put true witnesses before false witnesses - #144545

Merged
bors merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:bool-witness-order
Aug 9, 2025
Merged

bors merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:bool-witness-order

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

In rustc it doesn't really matter what the order of the witnesses is, but I'm planning to use the witnesses for implementing the "add missing match arms" assist in rust-analyzer, and there true before false is the natural order (like Some before None), and also what the current assist does.

The current order doesn't seem to be intentional; the code was created when bool ctors became their own thing, not just int ctors, but for integer, 0 before 1 is indeed the natural order.

r? @Nadrieril

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants