-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Initial implementation of or-pattern usefulness checking #66612
Conversation
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
Awaiting bors try build completion |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Initial implementation of or-pattern usefulness checking The title says it all. I'd like to request a perf run on that, hopefully this doesn't kill performance too much. cc #54883
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-azure |
Queued 320df38 with parent 5fa0af2, future comparison URL. |
Finished benchmarking try commit 320df38, comparison URL. |
} | ||
|
||
match (0u8,) { | ||
(1 | 1,) => {} // redundancy not detected for now |
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 assume you have plans for this somehow... =P
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 do ^^. This is actually necessary if we want to remove the hack for top-level or-patterns and keep the same diagnostics. I'll have a follow-up PR up soon
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.
Looks good as an initial implementation but then again the algorithm in _match.rs
is not something I'm really familiar with so @varkor should do the approving.
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.
Changes look good — r=me with the nits fixed.
Co-Authored-By: varkor <github@varkor.com>
Great, thank you very much for working on this! @bors r+ |
📌 Commit 0f4c5fb has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
…rkor Initial implementation of or-pattern usefulness checking The title says it all. I'd like to request a perf run on that, hopefully this doesn't kill performance too much. cc rust-lang#54883
Rollup of 9 pull requests Successful merges: - #66612 (Initial implementation of or-pattern usefulness checking) - #66705 (Atomic as_mut_ptr) - #66759 (impl TrustedLen for vec::Drain) - #66858 (Use LLVMAddAnalysisPasses instead of Rust's wrapper) - #66870 (SimplifyArmIdentity only for locals with the same type) - #66883 (rustc_typeck: gate AnonConst's generics on feature(const_generics).) - #66889 (Make python-generated source files compatible with rustfmt) - #66894 (Remove unneeded prelude imports in libcore tests) - #66895 (Feature gating *declarations* => new crate `rustc_feature`) Failed merges: - #66905 (rustc_plugin: Remove some remaining plugin features) r? @ghost
☔ The latest upstream changes (presumably #66908) made this pull request unmergeable. Please resolve the merge conflicts. |
I'm confused, bors merged the PR and then detected a conflict with itself ? Is that a false positive from bors or do I need to rebase on master ? |
That's a false positive from the buggy bors; no need to do anything. |
Remove hack for top-level or-patterns in match checking Follow-up to rust-lang#66612. Or-patterns are now truly first-class in match checking. As a side-effect, redundant subpatterns are linted as such, making the `unreachable_patterns` lint a bit more general. cc rust-lang#54883 r? @varkor
Remove hack for top-level or-patterns in match checking Follow-up to rust-lang#66612. Or-patterns are now truly first-class in match checking. As a side-effect, redundant subpatterns are linted as such, making the `unreachable_patterns` lint a bit more general. cc rust-lang#54883 r? @varkor
😱 How dare you insult the @bors 💥 HE SEES ALLLLLLLLLL |
The title says it all.
I'd like to request a perf run on that, hopefully this doesn't kill performance too much.
cc #54883