mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-13 04:26:48 +00:00
assigning a (MIR) box into an lvalue allocates heap storage that will
need to be initialized. create a MoveOut to represent that deref'ed `*lval` path.
This commit is contained in:
parent
5508c40d04
commit
dd99f58fe1
@ -554,7 +554,11 @@ fn gather_moves<'tcx>(mir: &Mir<'tcx>, tcx: &ty::TyCtxt<'tcx>) -> MoveData<'tcx>
|
||||
Rvalue::Box(ref _ty) => {
|
||||
// this is creating uninitialized
|
||||
// memory that needs to be initialized.
|
||||
bb_ctxt.on_move_out_lval(SK::Box, lval, source);
|
||||
let deref_lval = Lvalue::Projection(Box::new( repr::Projection {
|
||||
base: lval.clone(),
|
||||
elem: repr::ProjectionElem::Deref,
|
||||
}));
|
||||
bb_ctxt.on_move_out_lval(SK::Box, &deref_lval, source);
|
||||
}
|
||||
Rvalue::Aggregate(ref _kind, ref operands) => {
|
||||
for operand in operands {
|
||||
|
Loading…
Reference in New Issue
Block a user