Skip to content

Commit 57b3ddc

Browse files
committed
Auto merge of #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 3e89e0b + 9e3b484 commit 57b3ddc

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)