-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify constructor splitting in exhaustiveness checking #80242
Clarify constructor splitting in exhaustiveness checking #80242
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. |
⌛ Trying commit ddc29bf59218179b7b829d9f7a99121d8e9932fb with merge 92e2d3444aa509193c1d1e464229151050a23df7... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
ddc29bf
to
6d885fb
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion. |
⌛ Trying commit 6d885fb79cc8105204f03736a4b5cc13da4377ec with merge 63732d777c405f4a8e36687aaee37dadf67b14bc... |
☀️ Try build successful - checks-actions |
Queued 63732d777c405f4a8e36687aaee37dadf67b14bc with parent b0e5c7d, future comparison URL. @rustbot label: +S-waiting-on-perf |
Finished benchmarking try commit (63732d777c405f4a8e36687aaee37dadf67b14bc): comparison url. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up. @bors rollup=never |
This is a slight regression. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the changes after the few minor comments, but maybe you have an idea about how to avoid the regression, @Nadrieril? I think it's negligible enough not to worry, but perhaps an #[inline]
in the right place could do the trick.
/// [..] => {} | ||
/// } | ||
/// ``` | ||
/// Here are the results of specialization for the first few lengths: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is nice and clear :)
6494fba
to
3e5ba51
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
3e5ba51
to
7cf3783
Compare
Thanks for spotting all my typos! I've stared at it for too long I can't see them myself anymore ^^. |
☔ The latest upstream changes (presumably #78242) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
Co-authored-by: varkor <github@varkor.com>
7cf3783
to
be23694
Compare
Thanks! @bors r+ |
📌 Commit be23694 has been approved by |
☀️ Test successful - checks-actions |
I reworked the explanation of the algorithm completely to make it properly account for the various extensions we've added. This includes constructor splitting, which was previously not clearly included in the algorithm. This makes wildcards less magical; I added some detailed examples; and this distinguishes clearly between constructors that only make sense in patterns (like ranges) and those that make sense for values (like
Some
). This reformulation had been floating around in my mind for a while, and I'm quite happy with how it turned out. Let me know how you feel about it.I also factored out all three cases of splitting (wildcards, ranges and slices) into dedicated structs to encapsulate the complicated bits.
I measured no perf impact but I don't trust my local measurements for refactors since #79284.
r? @varkor
@rustbot modify labels: +A-exhaustiveness-checking