Skip to content

Commit 699a6be

Browse files
committed
Auto merge of rust-lang#147687 - cjgillot:noshallow-init-box, r=nnethercote
Forbid ShallowInitBox after box deref elaboration. MIR currently contains a `ShallowInitBox` rvalue. Its principal usage is to allow for in-place initialization of boxes. Having it is necessary for drop elaboration to be correct with that in-place initialization. As part of analysis->runtime MIR lowering, we canonicalize deref of boxes to use the stored raw pointer. But we did not perform the same change to the construction of the box. This PR replaces `ShallowInitBox` by the pointer manipulation it represents. Alternatives: - fully remove `ShallowInitBox` and implement `Box` in-place initialization differently; - remove the `ElaborateBoxDeref` pass and keep dereferencing `Box` in runtime MIR.
2 parents 1486d5e + aa01e6d commit 699a6be

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)