-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Consider fields to be inhabited if they are unstable #133889
Conversation
@bors try @rust-timer queue (to prepare a try-build for crater if necessary, and to gauge the impact of the stability lookup which ideally should be pretty cheap) |
This comment has been minimized.
This comment has been minimized.
Consider fields to be inhabited if they are unstable Fixes rust-lang#133885 with a simple heuristic r? Nadrieril Not totally certain if this needs T-lang approval or a crater run.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Consider fields to be inhabited if they are unstable Fixes rust-lang#133885 with a simple heuristic r? Nadrieril Not totally certain if this needs T-lang approval or a crater run.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (c9f0231): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking 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 may lead 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 Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 1.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -2.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.678s -> 768.797s (-0.11%) |
Hmm, this fixes the issue for |
That'd be a bigger breaking change though, we can fix this first. I'm ok with this PR and I also don't know how to proceed here. Are there any other structs in std that could be affected by this? They'd need to be unstable, public, and directly depend on a generic parameter. |
On second thought, we should also ignore unstable fields here:
so that a pattern like |
Good point.
Not from a cursory search. The only types that seem to be affected are the new range types (that are themselves not stable): https://doc.rust-lang.org/nightly/core/range/
I kinda wish that exhaustiveness was opt-in rather than opt-out. This seems really weird to make |
Thanks for looking into it!
Oh yeah, I was thinking we should take both into account. And yeah having |
@Nadrieril: Making a field public to private, even if it's |
It is technically breaking in that it can break code that compiles, but cargo-semver-checks would consider that non-breaking I believe (they have clever handling of doc(hidden)), so I'm inclined to follow their lead. |
If an unihabitedness determination relies exclusively on |
I actually don't know what you're asking for here. Specifically,
@rustbot ready |
bacd80b
to
4709b18
Compare
ping @Nadrieril |
This is not theoretical: the code in exhaustiveness must be kept in sync with what we consider inhabited else there will be weird discrepancies. The tests I suggested (specifically #[deny(unreachable)]
fn foo(x: Pin<Void>) {
match x {
Pin { .. } => {}
}
} Don't remember why I asked for a @rustbot author |
…-if-unmarked to be uninhabited
4709b18
to
0a6a0e4
Compare
Some changes occurred in exhaustiveness checking cc @Nadrieril |
@rustbot ready |
Ty! @bors r+ |
🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened. |
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 87e60a7 (parent) -> d8e44b7 (this PR) Test differencesShow 11 test diffs
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index
|
Finished benchmarking commit (d8e44b7): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowOur benchmarks found a performance regression caused by this PR. Next Steps:
@rustbot label: +perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 1.3%, secondary -1.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 773.84s -> 775.297s (0.19%) |
Fixes #133885 with a simple heuristic
r? Nadrieril
Not totally certain if this needs T-lang approval or a crater run.