-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Deref is not a projection: VarDebugInfo #146710
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
base: master
Are you sure you want to change the base?
Deref is not a projection: VarDebugInfo #146710
Conversation
|
5c72b0b
to
bc84a6c
Compare
This comment has been minimized.
This comment has been minimized.
r? mir |
This comment has been minimized.
This comment has been minimized.
bc84a6c
to
1101f1b
Compare
Do you mind extracting the changes to ref_prop into a standalone PR? |
Deref related cleanups in ref_prop Cherry picked from #146710 r? cjgillot
…=cjgillot Deref related cleanups in ref_prop Cherry picked from rust-lang#146710 r? cjgillot
…=cjgillot Deref related cleanups in ref_prop Cherry picked from rust-lang#146710 r? cjgillot
…=cjgillot Deref related cleanups in ref_prop Cherry picked from rust-lang#146710 r? cjgillot
makes it easier to change in the future, which will be needed for borrowck and co
1101f1b
to
d32ca9b
Compare
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
The stable Mir currently supports the after analysis MIR only. Is there any semantic difference at that level between CompoundPlace and regular Place? If not, you can just translate it to Place. Otherwise, please add a CompoundPlace. Thanks |
…=cjgillot Deref related cleanups in ref_prop Cherry picked from rust-lang#146710 r? cjgillot
Yes, it probably makes sense to add CompoundPlace to stable MIR then. It would need it eventually when ProjectionElem::Deref is fully removed anyway. |
☔ The latest upstream changes (presumably #142771) made this pull request unmergeable. Please resolve the merge conflicts. |
See rust-lang/compiler-team#532
The
Derefer
MIR pass ensures that all places' projections are an optional deref followed by a direct projection (no derefs, points to the same region of memory), except inVarDebugInfo
. There is no way to represent debug info's places in general like this.To solve this, this PR introduces
CompoundPlace
andCompoundPlaceRef
to for places with multiple derefs in arbitrary positions by instead representing them as multiple direct projections seperated by derefs. These types are also necessary for movingDerefer
before borrowck because having to deal with these split-up single-deref places in borrowck would be a nightmare (I tried already).Couple points of uncertainty:
rustc_middle::mir::statement
along sidePlace
's methods andPlaceRef
, not sure if that's the best placeCompoundPlace
is just turned into a regularPlace
in stable MIR. Should it?r? oli-obk (not sure if they're still on vacation)