diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 98d9a0a7c6f5e..ab1304acf2a58 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -1610,7 +1610,7 @@ impl<'tcx> Statement<'tcx> { #[derive(Clone, Debug, RustcEncodable, RustcDecodable)] pub enum StatementKind<'tcx> { /// Write the RHS Rvalue to the LHS Place. - Assign(Place<'tcx>, Rvalue<'tcx>), + Assign(Place<'tcx>, Box>), /// This represents all the reading that a pattern match may do /// (e.g. inspecting constants and discriminant values), and the diff --git a/src/librustc_mir/borrow_check/error_reporting.rs b/src/librustc_mir/borrow_check/error_reporting.rs index 3fdb7d7f27d7e..ceed3e4744c80 100644 --- a/src/librustc_mir/borrow_check/error_reporting.rs +++ b/src/librustc_mir/borrow_check/error_reporting.rs @@ -1221,7 +1221,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { ); if let StatementKind::Assign( Place::Local(assigned_to), - rvalue, + box rvalue, ) = &stmt.kind { debug!("annotate_argument_and_return_for_borrow: assigned_to={:?} \ rvalue={:?}", assigned_to, rvalue); @@ -1725,7 +1725,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { None => return OtherUse(self.mir.source_info(location).span), }; - if let StatementKind::Assign(_, Rvalue::Aggregate(ref kind, ref places)) = stmt.kind { + if let StatementKind::Assign(_, box Rvalue::Aggregate(ref kind, ref places)) = stmt.kind { if let AggregateKind::Closure(def_id, _) = **kind { debug!("find_closure_move_span: found closure {:?}", places); @@ -1788,7 +1788,8 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> { } for stmt in &self.mir[location.block].statements[location.statement_index + 1..] { - if let StatementKind::Assign(_, Rvalue::Aggregate(ref kind, ref places)) = stmt.kind { + if let StatementKind::Assign(_, box Rvalue::Aggregate(ref kind, ref places)) + = stmt.kind { if let AggregateKind::Closure(def_id, _) = **kind { debug!("find_closure_borrow_span: found closure {:?}", places); diff --git a/src/librustc_mir/borrow_check/move_errors.rs b/src/librustc_mir/borrow_check/move_errors.rs index 8a97f25ef5813..1c55806872d57 100644 --- a/src/librustc_mir/borrow_check/move_errors.rs +++ b/src/librustc_mir/borrow_check/move_errors.rs @@ -100,7 +100,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { // flow could be used. if let Some(StatementKind::Assign( Place::Local(local), - Rvalue::Use(Operand::Move(move_from)), + box Rvalue::Use(Operand::Move(move_from)), )) = self.mir.basic_blocks()[location.block] .statements .get(location.statement_index) diff --git a/src/librustc_mir/build/cfg.rs b/src/librustc_mir/build/cfg.rs index 8e40fd19941b3..619ebb1675ca6 100644 --- a/src/librustc_mir/build/cfg.rs +++ b/src/librustc_mir/build/cfg.rs @@ -76,7 +76,7 @@ impl<'tcx> CFG<'tcx> { rvalue: Rvalue<'tcx>) { self.push(block, Statement { source_info, - kind: StatementKind::Assign(place.clone(), rvalue) + kind: StatementKind::Assign(place.clone(), box rvalue) }); } diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs index ed2f780baf1c2..caf87fdd5ccce 100644 --- a/src/librustc_mir/dataflow/impls/borrows.rs +++ b/src/librustc_mir/dataflow/impls/borrows.rs @@ -270,7 +270,7 @@ impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> { // re-consider the current implementations of the // propagate_call_return method. - if let mir::Rvalue::Ref(region, _, ref place) = *rhs { + if let mir::Rvalue::Ref(region, _, ref place) = **rhs { if place.ignore_borrow( self.tcx, self.mir, diff --git a/src/librustc_mir/shim.rs b/src/librustc_mir/shim.rs index a6c0397568578..7ba72366af736 100644 --- a/src/librustc_mir/shim.rs +++ b/src/librustc_mir/shim.rs @@ -407,7 +407,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let ret_statement = self.make_statement( StatementKind::Assign( Place::Local(RETURN_PLACE), - Rvalue::Use(Operand::Copy(rcvr)) + box Rvalue::Use(Operand::Copy(rcvr)) ) ); self.block(vec![ret_statement], TerminatorKind::Return, false); @@ -458,7 +458,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let statement = self.make_statement( StatementKind::Assign( ref_loc.clone(), - Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, src) + box Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, src) ) ); @@ -485,7 +485,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let compute_cond = self.make_statement( StatementKind::Assign( cond.clone(), - Rvalue::BinaryOp(BinOp::Ne, Operand::Copy(end), Operand::Copy(beg)) + box Rvalue::BinaryOp(BinOp::Ne, Operand::Copy(end), Operand::Copy(beg)) ) ); @@ -521,13 +521,13 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::Use(Operand::Constant(self.make_usize(0))) + box Rvalue::Use(Operand::Constant(self.make_usize(0))) ) ), self.make_statement( StatementKind::Assign( end.clone(), - Rvalue::Use(Operand::Constant(self.make_usize(len))) + box Rvalue::Use(Operand::Constant(self.make_usize(len))) ) ) ]; @@ -555,7 +555,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::BinaryOp( + box Rvalue::BinaryOp( BinOp::Add, Operand::Copy(Place::Local(beg)), Operand::Constant(self.make_usize(1)) @@ -578,7 +578,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let init = self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::Use(Operand::Constant(self.make_usize(0))) + box Rvalue::Use(Operand::Constant(self.make_usize(0))) ) ); self.block(vec![init], TerminatorKind::Goto { target: BasicBlock::new(6) }, true); @@ -605,7 +605,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { let statement = self.make_statement( StatementKind::Assign( Place::Local(beg), - Rvalue::BinaryOp( + box Rvalue::BinaryOp( BinOp::Add, Operand::Copy(Place::Local(beg)), Operand::Constant(self.make_usize(1)) @@ -715,7 +715,7 @@ fn build_call_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, source_info, kind: StatementKind::Assign( Place::Local(ref_rcvr), - Rvalue::Ref(tcx.types.re_erased, borrow_kind, rcvr_l) + box Rvalue::Ref(tcx.types.re_erased, borrow_kind, rcvr_l) ) }); Operand::Move(Place::Local(ref_rcvr)) @@ -851,7 +851,7 @@ pub fn build_adt_ctor<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>, source_info, kind: StatementKind::Assign( Place::Local(RETURN_PLACE), - Rvalue::Aggregate( + box Rvalue::Aggregate( box AggregateKind::Adt(adt_def, variant_no, substs, None, None), (1..sig.inputs().len()+1).map(|i| { Operand::Move(Place::Local(Local::new(i))) diff --git a/src/librustc_mir/transform/add_validation.rs b/src/librustc_mir/transform/add_validation.rs index 6efefdaa00400..5b489b5db942b 100644 --- a/src/librustc_mir/transform/add_validation.rs +++ b/src/librustc_mir/transform/add_validation.rs @@ -320,12 +320,12 @@ impl MirPass for AddValidation { for i in (0..block_data.statements.len()).rev() { match block_data.statements[i].kind { // When the borrow of this ref expires, we need to recover validation. - StatementKind::Assign(_, Rvalue::Ref(_, _, _)) => { + StatementKind::Assign(_, box Rvalue::Ref(_, _, _)) => { // Due to a lack of NLL; we can't capture anything directly here. // Instead, we have to re-match and clone there. let (dest_place, re, src_place) = match block_data.statements[i].kind { StatementKind::Assign(ref dest_place, - Rvalue::Ref(re, _, ref src_place)) => { + box Rvalue::Ref(re, _, ref src_place)) => { (dest_place.clone(), re, src_place.clone()) }, _ => bug!("We already matched this."), @@ -354,17 +354,17 @@ impl MirPass for AddValidation { block_data.statements.insert(i, release_stmt); } // Casts can change what validation does (e.g. unsizing) - StatementKind::Assign(_, Rvalue::Cast(kind, Operand::Copy(_), _)) | - StatementKind::Assign(_, Rvalue::Cast(kind, Operand::Move(_), _)) + StatementKind::Assign(_, box Rvalue::Cast(kind, Operand::Copy(_), _)) | + StatementKind::Assign(_, box Rvalue::Cast(kind, Operand::Move(_), _)) if kind != CastKind::Misc => { // Due to a lack of NLL; we can't capture anything directly here. // Instead, we have to re-match and clone there. let (dest_place, src_place) = match block_data.statements[i].kind { StatementKind::Assign(ref dest_place, - Rvalue::Cast(_, Operand::Copy(ref src_place), _)) | + box Rvalue::Cast(_, Operand::Copy(ref src_place), _)) | StatementKind::Assign(ref dest_place, - Rvalue::Cast(_, Operand::Move(ref src_place), _)) => + box Rvalue::Cast(_, Operand::Move(ref src_place), _)) => { (dest_place.clone(), src_place.clone()) }, diff --git a/src/librustc_mir/transform/copy_prop.rs b/src/librustc_mir/transform/copy_prop.rs index fba60c7e8dc27..6d0b25b2c6940 100644 --- a/src/librustc_mir/transform/copy_prop.rs +++ b/src/librustc_mir/transform/copy_prop.rs @@ -104,7 +104,7 @@ impl MirPass for CopyPropagation { // That use of the source must be an assignment. match statement.kind { - StatementKind::Assign(Place::Local(local), Rvalue::Use(ref operand)) if + StatementKind::Assign(Place::Local(local), box Rvalue::Use(ref operand)) if local == dest_local => { let maybe_action = match *operand { Operand::Copy(ref src_place) | @@ -155,11 +155,11 @@ fn eliminate_self_assignments<'tcx>( match stmt.kind { StatementKind::Assign( Place::Local(local), - Rvalue::Use(Operand::Copy(Place::Local(src_local))), + box Rvalue::Use(Operand::Copy(Place::Local(src_local))), ) | StatementKind::Assign( Place::Local(local), - Rvalue::Use(Operand::Move(Place::Local(src_local))), + box Rvalue::Use(Operand::Move(Place::Local(src_local))), ) if local == dest_local && dest_local == src_local => {} _ => { continue; diff --git a/src/librustc_mir/transform/deaggregator.rs b/src/librustc_mir/transform/deaggregator.rs index cff098c7b73d5..8a14890f92e1e 100644 --- a/src/librustc_mir/transform/deaggregator.rs +++ b/src/librustc_mir/transform/deaggregator.rs @@ -26,7 +26,7 @@ impl MirPass for Deaggregator { bb.expand_statements(|stmt| { // FIXME(eddyb) don't match twice on `stmt.kind` (post-NLL). if let StatementKind::Assign(_, ref rhs) = stmt.kind { - if let Rvalue::Aggregate(ref kind, _) = *rhs { + if let Rvalue::Aggregate(ref kind, _) = **rhs { // FIXME(#48193) Deaggregate arrays when it's cheaper to do so. if let AggregateKind::Array(_) = **kind { return None; @@ -41,8 +41,12 @@ impl MirPass for Deaggregator { let stmt = stmt.replace_nop(); let source_info = stmt.source_info; let (mut lhs, kind, operands) = match stmt.kind { - StatementKind::Assign(lhs, Rvalue::Aggregate(kind, operands)) - => (lhs, kind, operands), + StatementKind::Assign(lhs, box rvalue) => { + match rvalue { + Rvalue::Aggregate(kind, operands) => (lhs, kind, operands), + _ => bug!() + } + } _ => bug!() }; @@ -82,7 +86,7 @@ impl MirPass for Deaggregator { }; Statement { source_info, - kind: StatementKind::Assign(lhs_field, Rvalue::Use(op)), + kind: StatementKind::Assign(lhs_field, box Rvalue::Use(op)), } }).chain(set_discriminant)) }); diff --git a/src/librustc_mir/transform/elaborate_drops.rs b/src/librustc_mir/transform/elaborate_drops.rs index 92b6af8b51f7f..9d77289d7b9b1 100644 --- a/src/librustc_mir/transform/elaborate_drops.rs +++ b/src/librustc_mir/transform/elaborate_drops.rs @@ -478,7 +478,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> { assert!(!data.is_cleanup, "DropAndReplace in unwind path not supported"); let assign = Statement { - kind: StatementKind::Assign(location.clone(), Rvalue::Use(value.clone())), + kind: StatementKind::Assign(location.clone(), box Rvalue::Use(value.clone())), source_info: terminator.source_info }; diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs index 96111519550f6..62adbf1bdf7db 100644 --- a/src/librustc_mir/transform/generator.rs +++ b/src/librustc_mir/transform/generator.rs @@ -188,7 +188,7 @@ impl<'a, 'tcx> TransformVisitor<'a, 'tcx> { }); Statement { source_info, - kind: StatementKind::Assign(state, Rvalue::Use(val)), + kind: StatementKind::Assign(state, box Rvalue::Use(val)), } } } @@ -246,7 +246,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for TransformVisitor<'a, 'tcx> { data.statements.push(Statement { source_info, kind: StatementKind::Assign(Place::Local(RETURN_PLACE), - self.make_state(state_idx, v)), + box self.make_state(state_idx, v)), }); let state = if let Some(resume) = resume { // Yield let state = 3 + self.suspension_points.len() as u32; diff --git a/src/librustc_mir/transform/inline.rs b/src/librustc_mir/transform/inline.rs index 8689fde3ee640..3bbe2017ee874 100644 --- a/src/librustc_mir/transform/inline.rs +++ b/src/librustc_mir/transform/inline.rs @@ -447,7 +447,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> { let stmt = Statement { source_info: callsite.location, - kind: StatementKind::Assign(tmp.clone(), dest) + kind: StatementKind::Assign(tmp.clone(), box dest) }; caller_mir[callsite.bb] .statements.push(stmt); @@ -594,7 +594,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> { let stmt = Statement { source_info: callsite.location, - kind: StatementKind::Assign(Place::Local(arg_tmp), arg), + kind: StatementKind::Assign(Place::Local(arg_tmp), box arg), }; caller_mir[callsite.bb].statements.push(stmt); arg_tmp diff --git a/src/librustc_mir/transform/lower_128bit.rs b/src/librustc_mir/transform/lower_128bit.rs index 8ed5600400b51..b2ddbe04d755f 100644 --- a/src/librustc_mir/transform/lower_128bit.rs +++ b/src/librustc_mir/transform/lower_128bit.rs @@ -79,11 +79,14 @@ impl Lower128Bit { let bin_statement = block.statements.pop().unwrap(); let source_info = bin_statement.source_info; let (place, lhs, mut rhs) = match bin_statement.kind { - StatementKind::Assign(place, Rvalue::BinaryOp(_, lhs, rhs)) - | StatementKind::Assign(place, Rvalue::CheckedBinaryOp(_, lhs, rhs)) => { - (place, lhs, rhs) + StatementKind::Assign(place, box rvalue) => { + match rvalue { + Rvalue::BinaryOp(_, lhs, rhs) + | Rvalue::CheckedBinaryOp(_, lhs, rhs) => (place, lhs, rhs), + _ => bug!(), + } } - _ => bug!("Statement doesn't match pattern any more?"), + _ => bug!() }; if let Some(local) = cast_local { @@ -95,7 +98,7 @@ impl Lower128Bit { source_info: source_info, kind: StatementKind::Assign( Place::Local(local), - Rvalue::Cast( + box Rvalue::Cast( CastKind::Misc, rhs, rhs_override_ty.unwrap())), @@ -154,13 +157,13 @@ fn lower_to<'a, 'tcx, D>(statement: &Statement<'tcx>, local_decls: &D, tcx: TyCt where D: HasLocalDecls<'tcx> { match statement.kind { - StatementKind::Assign(_, Rvalue::BinaryOp(bin_op, ref lhs, _)) => { + StatementKind::Assign(_, box Rvalue::BinaryOp(bin_op, ref lhs, _)) => { let ty = lhs.ty(local_decls, tcx); if let Some(is_signed) = sign_of_128bit(ty) { return item_for_op(bin_op, is_signed); } }, - StatementKind::Assign(_, Rvalue::CheckedBinaryOp(bin_op, ref lhs, _)) => { + StatementKind::Assign(_, box Rvalue::CheckedBinaryOp(bin_op, ref lhs, _)) => { let ty = lhs.ty(local_decls, tcx); if let Some(is_signed) = sign_of_128bit(ty) { return item_for_checked_op(bin_op, is_signed); diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs index bb66b9ed6ece8..34339b0634194 100644 --- a/src/librustc_mir/transform/promote_consts.rs +++ b/src/librustc_mir/transform/promote_consts.rs @@ -182,7 +182,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { span, scope: OUTERMOST_SOURCE_SCOPE }, - kind: StatementKind::Assign(Place::Local(dest), rvalue) + kind: StatementKind::Assign(Place::Local(dest), box rvalue) }); } @@ -217,7 +217,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { // First, take the Rvalue or Call out of the source MIR, // or duplicate it, depending on keep_original. if loc.statement_index < no_stmts { - let (mut rvalue, source_info) = { + let (rvalue, source_info) = { let statement = &mut self.source[loc.block].statements[loc.statement_index]; let rhs = match statement.kind { StatementKind::Assign(_, ref mut rhs) => rhs, @@ -230,11 +230,12 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { (if self.keep_original { rhs.clone() } else { - let unit = Rvalue::Aggregate(box AggregateKind::Tuple, vec![]); + let unit = box Rvalue::Aggregate(box AggregateKind::Tuple, vec![]); mem::replace(rhs, unit) }, statement.source_info) }; + let mut rvalue = *rvalue; self.visit_rvalue(&mut rvalue, loc); self.assign(new_temp, rvalue, source_info.span); } else { @@ -301,7 +302,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { Candidate::Ref(loc) => { let ref mut statement = blocks[loc.block].statements[loc.statement_index]; match statement.kind { - StatementKind::Assign(_, Rvalue::Ref(_, _, ref mut place)) => { + StatementKind::Assign(_, box Rvalue::Ref(_, _, ref mut place)) => { // Find the underlying local for this (necessarily interior) borrow. // HACK(eddyb) using a recursive function because of mutable borrows. fn interior_base<'a, 'tcx>(place: &'a mut Place<'tcx>) diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index a997bd37c50a3..cf45b541f80d3 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -388,7 +388,7 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> { match *candidate { Candidate::Ref(Location { block: bb, statement_index: stmt_idx }) => { match self.mir[bb].statements[stmt_idx].kind { - StatementKind::Assign(_, Rvalue::Ref(_, _, Place::Local(index))) => { + StatementKind::Assign(_, box Rvalue::Ref(_, _, Place::Local(index))) => { promoted_temps.insert(index); } _ => {} diff --git a/src/librustc_mir/transform/remove_noop_landing_pads.rs b/src/librustc_mir/transform/remove_noop_landing_pads.rs index 298e38228d357..4b4b284b02cd5 100644 --- a/src/librustc_mir/transform/remove_noop_landing_pads.rs +++ b/src/librustc_mir/transform/remove_noop_landing_pads.rs @@ -60,7 +60,7 @@ impl RemoveNoopLandingPads { // instructions, but this should all run after borrowck). } - StatementKind::Assign(Place::Local(_), Rvalue::Use(_)) => { + StatementKind::Assign(Place::Local(_), box Rvalue::Use(_)) => { // Writing to a local (e.g. a drop flag) does not // turn a landing pad to a non-nop } diff --git a/src/librustc_mir/transform/rustc_peek.rs b/src/librustc_mir/transform/rustc_peek.rs index 487a18f6620b2..05044574e5ca3 100644 --- a/src/librustc_mir/transform/rustc_peek.rs +++ b/src/librustc_mir/transform/rustc_peek.rs @@ -171,7 +171,7 @@ fn each_block<'a, 'tcx, O>(tcx: TyCtxt<'a, 'tcx, 'tcx>, }; if place == peek_arg_place { - if let mir::Rvalue::Ref(_, mir::BorrowKind::Shared, ref peeking_at_place) = *rvalue { + if let mir::Rvalue::Ref(_, mir::BorrowKind::Shared, ref peeking_at_place) = **rvalue { // Okay, our search is over. match move_data.rev_lookup.find(peeking_at_place) { LookupResult::Exact(peek_mpi) => { diff --git a/src/librustc_mir/transform/uniform_array_move_out.rs b/src/librustc_mir/transform/uniform_array_move_out.rs index 78464b2a104ec..b123a846596e5 100644 --- a/src/librustc_mir/transform/uniform_array_move_out.rs +++ b/src/librustc_mir/transform/uniform_array_move_out.rs @@ -184,7 +184,7 @@ impl MirPass for RestoreSubsliceArrayMoveOut { for candidate in &visitor.candidates { let statement = &mir[candidate.block].statements[candidate.statement_index]; if let StatementKind::Assign(ref dst_place, ref rval) = statement.kind { - if let Rvalue::Aggregate(box AggregateKind::Array(_), ref items) = *rval { + if let Rvalue::Aggregate(box AggregateKind::Array(_), ref items) = **rval { let items : Vec<_> = items.iter().map(|item| { if let Operand::Move(Place::Local(local)) = item { let local_use = &visitor.locals_use[*local]; @@ -268,7 +268,7 @@ impl RestoreSubsliceArrayMoveOut { let statement = &block.statements[location.statement_index]; if let StatementKind::Assign( Place::Local(_), - Rvalue::Use(Operand::Move(Place::Projection(box PlaceProjection{ + box Rvalue::Use(Operand::Move(Place::Projection(box PlaceProjection{ ref base, elem: ProjectionElem::ConstantIndex{ offset, min_length: _, from_end: false}})))) = statement.kind { return Some((offset, base)) diff --git a/src/librustc_mir/util/elaborate_drops.rs b/src/librustc_mir/util/elaborate_drops.rs index 50bdc14d50995..9b8165181cc1d 100644 --- a/src/librustc_mir/util/elaborate_drops.rs +++ b/src/librustc_mir/util/elaborate_drops.rs @@ -977,7 +977,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D> fn assign(&self, lhs: &Place<'tcx>, rhs: Rvalue<'tcx>) -> Statement<'tcx> { Statement { source_info: self.source_info, - kind: StatementKind::Assign(lhs.clone(), rhs) + kind: StatementKind::Assign(lhs.clone(), box rhs) } } } diff --git a/src/librustc_mir/util/patch.rs b/src/librustc_mir/util/patch.rs index c2a56adc18f5c..807c8386693f8 100644 --- a/src/librustc_mir/util/patch.rs +++ b/src/librustc_mir/util/patch.rs @@ -130,7 +130,7 @@ impl<'tcx> MirPatch<'tcx> { } pub fn add_assign(&mut self, loc: Location, place: Place<'tcx>, rv: Rvalue<'tcx>) { - self.add_statement(loc, StatementKind::Assign(place, rv)); + self.add_statement(loc, StatementKind::Assign(place, box rv)); } pub fn make_nop(&mut self, loc: Location) {