-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Cleanup BodyCache #66991
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cleanup BodyCache #66991
Conversation
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
r? @eddyb |
This should address @eddyb 's comments here #64736 (comment) (and the comments below in that link). |
@@ -220,10 +220,6 @@ impl ReadOnlyBodyCache<'a, 'tcx> { | |||
self.cache.unwrap_predecessor_locations(loc, self.body) | |||
} | |||
|
|||
pub fn body(&self) -> &'a Body<'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.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
impl Deref for ReadOnlyBodyCache<'a, 'tcx> { | ||
type Target = Body<'tcx>; | ||
impl Deref for ReadOnlyBodyAndCache<'a, 'tcx> { | ||
type Target = &'a Body<'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.
Btw as I mentioned on the original PR, I've made this change in #65947, so I'd prefer landing that first.
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 saw that. I didn't plan to merge this until that one was merged first. I just wanted to make that change in this branch too so I could verify that the other changes wouldn't cause any issues. I'll update the main detail of the PR to make note of that.
☔ The latest upstream changes (presumably #65947) made this pull request unmergeable. Please resolve the merge conflicts. |
2325c6c
to
ebe79b0
Compare
@eddyb I rebased the PR and updated the main comment to reflect the minimized changes. Let me know if this still makes sense to move forward, otherwise I can just close this PR. |
☔ The latest upstream changes (presumably #66815) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
r=me after rebase
…nneeded Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
ebe79b0
to
a5e144b
Compare
@bors r=eddyb |
📌 Commit a5e144b has been approved by |
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in rust-lang#65947) cc @eddyb @oli-obk
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in rust-lang#65947) cc @eddyb @oli-obk
Cleanup BodyCache After this PR: - `BodyCache` is renamed to `BodyAndCache` - `ReadOnlyBodyCache` is renamed to `ReadOnlyBodyAndCache` - `ReadOnlyBodyAndCache::body` fn is removed and all calls to it are replaced by a deref (possible due to fix of its `Deref` imp in rust-lang#65947) cc @eddyb @oli-obk
Rollup of 5 pull requests Successful merges: - #66325 (Change unused_labels from allow to warn) - #66991 (Cleanup BodyCache) - #67101 (use `#[allow(unused_attributes)]` to paper over incr.comp problem) - #67114 (Make `ForeignItem` an alias of `Item`.) - #67129 (Fixes typo) Failed merges: - #66886 (Remove the borrow check::nll submodule) r? @ghost
After this PR:
BodyCache
is renamed toBodyAndCache
ReadOnlyBodyCache
is renamed toReadOnlyBodyAndCache
ReadOnlyBodyAndCache::body
fn is removed and all calls to it are replaced by a deref (possible due to fix of itsDeref
imp in rustc: split FnAbi's into definitions/direct calls ("of_instance") and indirect calls ("of_fn_ptr"). #65947)cc @eddyb @oli-obk