-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix array drop glue: properly turn raw ptr into reference #53536
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
Conversation
📌 Commit 0447b50 has been approved by |
I'm not sure how legitimate it is to call |
I do not understand -- |
Also, I couldn't actually figure out how |
rust/src/librustc_mir/util/elaborate_drops.rs Lines 632 to 636 in 1558ae7
The mir that you want to look at is probably the one generated here: Lines 160 to 236 in 6a3db03
|
Ah so it moves on to the EDIT: OTOH, I do not see why. If the reference is valid enough for |
fix array drop glue: properly turn raw ptr into reference Discovered while working on #53424: The generated drop glue uses an assignment `ptr = cur` where `ptr` is a reference and `cur` a raw pointer. This is not well-formed MIR. Do we have MIR sanity checks that run on the drop glue and should have caught this? r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
Discovered while working on #53424: The generated drop glue uses an assignment
ptr = cur
whereptr
is a reference andcur
a raw pointer. This is not well-formed MIR.Do we have MIR sanity checks that run on the drop glue and should have caught this?
r? @eddyb