-
Notifications
You must be signed in to change notification settings - Fork 13.5k
rustc_pattern_analysis
: always check that deref patterns don't match on the same place as normal constructors
#143472
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
Conversation
|
Some changes occurred in exhaustiveness checking cc @Nadrieril rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer Some changes occurred in match checking cc @Nadrieril |
This comment has been minimized.
This comment has been minimized.
This makes it work for box patterns and in rust-analyzer.
a448469
to
bb64315
Compare
Do you want to try keeping just the first commit so we can do a perf run? Mostly out of curiosity, second commit looks good to me. |
I'm a little curious too; is it possible to do a try build just for the first one? But if the second commit is fine, I don't see a reason not to keep the improvement! May as well not burden the build/perf infra. |
Fair, let's merge then :) @bors r+ rollup=iffy |
☀️ 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 558d253 (parent) -> 6b3ae3f (this PR) Test differencesShow 12 test diffsStage 1
Stage 2
Additionally, 10 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 6b3ae3f6e45a33c2d95fa0362c9b2593e567fd34 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
In #140106, deref pattern validation was tied to the
deref_patterns
feature to temporarily avoid affecting perf. However:rustc_pattern_analysis
. Since they can be used by enablingbox_patterns
instead ofderef_patterns
, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test.compute_match_usefulness
validate deref patterns by default.In order to avoid doing an extra pass for anything with patterns, the second commit makes
RustcPatCtxt
keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter.r? @Nadrieril