-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use PlaceRef abstractions more often #112693
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
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @b-naber (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
@rustbot label +S-waiting-on-author -S-waiting-on-review |
This comment has been minimized.
This comment has been minimized.
ae0c5b3
to
3263fee
Compare
@ericmarkmartin this is looking good IMO. |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@rustbot label -S-waiting-on-author +S-waiting-on-review |
}, | ||
projection: tcx.mk_place_elems(place_ref.projection), | ||
} | ||
.project_deeper(&[elem], tcx), |
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.
Could you add a project_deeper
method on PlaceRef
, to avoid interning twice?
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.
Or should BorrowedContent
take a PlaceRef
?
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.
I think PlaceRef
already had that. I'm not sure I'm really qualified to have a take on what BorrowedContent
should take but even if it took a PlaceRef
we'd need some way to produce the extended PlaceRef
. We could also try building the iterator so that we have access to the subsequent projection in each iteration, but I'm not sure how worth it that is.
local: place.local, | ||
projection: tcx.mk_place_elems(place_ref.projection), | ||
} | ||
.project_deeper(&[elem], tcx) |
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.
Likewise.
let parent = Place { | ||
local: place_ref.local, | ||
projection: self.tcx.mk_place_elems(place_ref.projection), | ||
}; |
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.
Why can't we use place_ref
directly here?
let parent = Place { | ||
local: place_ref.local, | ||
projection: self.tcx.mk_place_elems(place_ref.projection), | ||
}; |
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.
Can we use place_ref
directly in this code?
Thanks! r=me with commits squashed. |
This looks great now, please squash the commits into one or into a few of meaningful commits and then we can merge. Thanks for your work. |
9ee0406
to
c07c10d
Compare
r? @cjgillot |
@bors r+ |
Thanks @spastorino and @cjgillot (and the rustc-dev-guide) for making the experience of writing my first PR to rust so pleasant! |
☀️ Test successful - checks-actions |
Finished benchmarking commit (b9ad9b7): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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: 662.213s -> 661.833s (-0.06%) |
cargo and bitmaps noise, stabilized in the next merge. @rustbot label: +perf-regression-triaged |
@ericmarkmartin thanks to you for the contribution. Let's keep in touch on Zulip in case you want to contribute more :). |
Associated issue: #80647
r? @spastorino