-
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
pattern_analysis: track usefulness without interior mutability #120324
Conversation
r? @cjgillot (rustbot has picked a reviewer for you, use r? to override) |
r? @ghost |
Failed to set assignee to
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…, r=<try> Experiment: track usefulness without interior mutability This would remove a potential footgun in r-a. Just wanna see if this kills perf
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (09d4a12): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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: 664.789s -> 665.467s (0.10%) |
8f04a1e
to
11a3f5d
Compare
11a3f5d
to
8c7e726
Compare
r? @compiler-errors |
This comment was marked as resolved.
This comment was marked as resolved.
560e150
to
5747965
Compare
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.
Hmm... I have mixed feelings about using address-based indexing here :|
Is there any way we could give some other kind of unique ID to all the DeconstructedPat
s for use in tracking this state instead?
We could store a |
Yeah, spans are a no-go. They're not unique. I would prefer a real dedicated ID. Why does it need to be atomic? We don't expect it to be modified after the |
Oh indeed, I meant storing a |
bd804d2
to
be29cd1
Compare
@rustbot ready |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (74c3f5a): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 664.301s -> 664.029s (-0.04%) |
Because of or-patterns, exhaustiveness needs to be able to lint if a sub-pattern is redundant, e.g. in
Some(_) | Some(true)
. So far the only sane solution I had found was interior mutability. This is a bit of an abstraction leak, and would become a footgun if we ever reused the sameDeconstructedPat
. This PR replaces interior mutability with an address-indexed hashmap, which is logically equivalent.