Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Remove interior mutability in mir predecessors cache #64736
Remove interior mutability in mir predecessors cache #64736
Changes from all commits
c16ef6b
b524059
ce29f43
f534d9f
2b31456
e1afa51
570e418
8e8c97e
ad73468
94414ac
52cc85f
22bc8a0
9b335ce
c0592fa
649c73f
30b1d9e
3d68f5f
16952cc
66279d1
c8c266a
2eed90a
ab98c59
26f1c01
0a19371
3642a71
38c0887
fc6b58d
4de31b2
35590b5
67b7a78
ab657e3
e54c610
c42bdb8
595d161
b2fe254
51b0665
ed90818
05dc5e9
245abc4
c6354e9
598797c
64654ce
9978574
acb90eb
38bd3a2
6123478
3eaad56
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This should probably be named
BodyAndCache
to alleviate confusion.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.
This doesn't need to take self by mut ref.
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.
It does.
Cache
'sensure_predecessors
takesself
by mut ref (https://github.com/rust-lang/rust/pull/64736/files/3eaad564d25402013bdf5591c453c916b49cdf93#diff-f1f20e32c0d3522f2f33135df0f4696bR47), and that requires thatself.cache
here below is taken by mut ref. That's only possible if you have&mut self
. Or is there some detail I'm overlooking?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.
Oof, this is a common mistake for wrappers of references.
The target should be the reference,
&'a Body<'tcx>
, so that you can actually get e.g.&'tcx mir::BasicBlockData<'tcx>
when'a = 'tcx
.I wonder if this PR added any lifetimes to existing code to work around that (likely not codegen because that was already wrongly using&'a Body<'tcx>
instead of&'tcx Body<'tcx>
).EDIT: thankfully doesn't seem like it. I will likely fix the
Deref
impl in #65947.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 don't think you need this, since you have
Deref
.