-
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
cleanup region handling: add LateParamRegionKind
#133961
base: master
Are you sure you want to change the base?
Conversation
e5e02ac
to
6f5bf6c
Compare
HIR ty lowering was modified cc @fmease Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
some cleanup to our region handling The second commit is to enable a split between `BoundRegionKind` and `LateParamRegionKind`, by avoiding `BoundRegionKind` where it isn't necessary. The third comment then adds `LateParamRegionKind` to avoid having the same late-param region for separate bound regions. r? `@compiler-errors`
LateParamRegionKind
a52c918
to
4086a6b
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
cleanup region handling: add `LateParamRegionKind` The second commit is to enable a split between `BoundRegionKind` and `LateParamRegionKind`, by avoiding `BoundRegionKind` where it isn't necessary. The third comment then adds `LateParamRegionKind` to avoid having the same late-param region for separate bound regions. This fixes rust-lang#124021. r? `@compiler-errors`
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.
Just very quickly skimmed over the diff....
Why not just add a u32
to BoundRegionKind::Anon
? When would you use ReLateParam
vs ReBound
?
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/util.rs
Outdated
Show resolved
Hide resolved
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (10ac87b): comparison URL. Overall result: ✅ improvements - 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 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)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: 769.713s -> 766.853s (-0.37%) |
because we've previously removed that index in #110036 🤔 unsure whether simply adding it back causes any issues. If not, that's probably easier and i'll redo the last commit here |
Yes I remember this - at the time, this index was only used for diagnostics, so this PR represents a shift in that. But seemingly we're in a place that we need that. I'm not sure if the def_id for Named has always been "load-bearing" or used to also only be for diagnostics. Personally, I think that the "real" solution is probably to use the info in the binders list if we need to track info (but likely it's more complicated than that, and either way is a larger change than what you probably want to make here). |
FWIW, the first two commits stand well enough alone for me, so if you want to split those and land them, you can r=me on that |
I've looked into changing wip commit: https://github.com/lcnr/rust/pull/new/br-anon-index @rustbot ready on the last 2 commits Footnotes
|
r? @jackh726 |
4086a6b
to
af79a36
Compare
…ackh726 small borrowck cleanup the already approved parts of rust-lang#133909 and rust-lang#133961 r? `@jackh726`
Rollup merge of rust-lang#134412 - lcnr:borrowck-cleanup-trivial, r=jackh726 small borrowck cleanup the already approved parts of rust-lang#133909 and rust-lang#133961 r? `@jackh726`
☔ The latest upstream changes (presumably #134414) made this pull request unmergeable. Please resolve the merge conflicts. |
Hmm, I think maybe I need to think about it a bit more... Your wip commit looks mostly fine to me. Which makes me kind of go back and look at this PR: how exactly do these changes fix #124021? Presumably we compare I guess, I can only speculate without looking directly at the code where the bug is, but I imagine we either have just lost the |
The bug is that https://doc.rust-lang.org/nightly/nightly-rustc/rustc_borrowck/universal_regions/struct.UniversalRegionIndices.html#structfield.indices maps from We then use this map to instantiate Imo the bug here is clearly the fact that we map two anonymous bound regions to the same |
Ah yes, I see it and understand now. r=me after rebase |
af79a36
to
4d5aaa0
Compare
@bors r+ |
@bors r=jackh726 |
💡 This pull request was already approved, no need to approve it again.
|
The second commit is to enable a split between
BoundRegionKind
andLateParamRegionKind
, by avoidingBoundRegionKind
where it isn't necessary.The third comment then adds
LateParamRegionKind
to avoid having the same late-param region for separate bound regions. This fixes #124021.r? @compiler-errors