-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix: non_exhaustive_omitted_patterns by filtering unstable and doc hidden variants #89105
Conversation
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
Nice, that was quick! I'd just ask for separate tests for the unstable part and the
#![feature(staged_api)]
#![stable(feature = "stable_test_feature", since = "1.0.0")]
#[unstable(feature = "unstable_test_feature", issue = "none")]
pub enum Foo {
...
} Look at e.g. |
Btw I'm only revieweing the logic, I don't feel competent to review the actual diagnostic change. |
1b2bd84
to
6fe5c48
Compare
This comment has been minimized.
This comment has been minimized.
330e369
to
6cd3f8a
Compare
Hopefully, these commits are clear enough and I didn't go the other way (splitting them too much so they are hard to interpret as a whole). |
Woo, great! LGTM. I expect a perf degradation because of the extra stability test. The @bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 6cd3f8afa896b6ad831e7ed202a34ef13a35371c with merge 7504632cc026b5926702afbf29cbd36579ad93fb... |
☀️ Try build successful - checks-actions |
Queued 7504632cc026b5926702afbf29cbd36579ad93fb with parent ac2d9fc, future comparison URL. |
Finished benchmarking commit (7504632cc026b5926702afbf29cbd36579ad93fb): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. @bors rollup=never |
@DevinR528 if you're curious, my general rules for splitting commits: each commit should compile and make sense on its own (I also commit the test outputs), and if two changes make sense individually I commit them separately. So I often end up with a ton of small commits ^^'. I haven't completely figured out how to limit that |
@Nadrieril cool thanks for the commt feedback/ideas! I will defiantly keep that in mind/try to use that as a guide. Of course, no perf problems when we both expect them 🙄, you just never know. |
Merge conflict incoming because of #88950 . It's a rather massive change, but the main difference for this PR is that I've replaced |
I started rebasing will hopefully have time to finish it today and I'll check out #89382 (comment) (but open separate PR to fix it) |
6cd3f8a
to
936b565
Compare
Queued aa7536dbf98257fbaa2f6b38c1acb694f6c3cf9a with parent 9a75781, future comparison URL. |
Finished benchmarking commit (aa7536dbf98257fbaa2f6b38c1acb694f6c3cf9a): comparison url. Summary: This change led to small relevant regressions 😿 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
This comment has been minimized.
This comment has been minimized.
Phew, took us a lot of tries but we're there. Any remaining comments @oli-obk? Otherwise r=me after squashing the commits. |
@bors r=Nadrieril |
📌 Commit 1c88c9463d1b2a2962485387e8b6d0e85f0a0c0d has been approved by |
Add test cases for unstable variants Add test cases for doc hidden variants Move is_doc_hidden to method on TyCtxt Add unstable variants test to reachable-patterns ui test Rename reachable-patterns -> omitted-patterns
1c88c94
to
2a042d6
Compare
Hm you pushed the squashed commits after bors recorded approval. I think this should unaccept the PR but bors hasn't noticed yet. Let's unaccept and reaccept. @bors r- |
@bors r+ |
📌 Commit 2a042d6 has been approved by |
Should I have done something differently or did bors mess up? |
🤷♀️ Neither, I just clarified a potential confusion around which commit is getting merged. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d7c97a0): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Fixes: #89042
Now that #86809 has been merged there are cases (std::io::ErrorKind) where unstable feature gated variants were included in warning/error messages when the feature was not turned on. This filters those variants out of the return of
SplitWildcard::new
.Variants marked
doc(hidden)
are filtered out of the witnesses list inUsefulness::apply_constructor
.Probably worth a perf run 🤷 since this area can be sensitive.