@@ -174,7 +174,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
174174 0 ,
175175 Statement {
176176 source_info,
177- kind : StatementKind :: Retag ( RetagKind :: Raw , box ( dropee_ptr) ) ,
177+ kind : StatementKind :: Retag ( RetagKind :: Raw , Box :: new ( dropee_ptr) ) ,
178178 } ,
179179 ) ;
180180 }
@@ -388,10 +388,10 @@ impl CloneShimBuilder<'tcx> {
388388
389389 fn copy_shim ( & mut self ) {
390390 let rcvr = self . tcx . mk_place_deref ( Place :: from ( Local :: new ( 1 + 0 ) ) ) ;
391- let ret_statement = self . make_statement ( StatementKind :: Assign ( box (
391+ let ret_statement = self . make_statement ( StatementKind :: Assign ( Box :: new ( (
392392 Place :: return_place ( ) ,
393393 Rvalue :: Use ( Operand :: Copy ( rcvr) ) ,
394- ) ) ) ;
394+ ) ) ) ) ;
395395 self . block ( vec ! [ ret_statement] , TerminatorKind :: Return , false ) ;
396396 }
397397
@@ -418,22 +418,22 @@ impl CloneShimBuilder<'tcx> {
418418
419419 // `func == Clone::clone(&ty) -> ty`
420420 let func_ty = tcx. mk_fn_def ( self . def_id , substs) ;
421- let func = Operand :: Constant ( box Constant {
421+ let func = Operand :: Constant ( Box :: new ( Constant {
422422 span : self . span ,
423423 user_ty : None ,
424424 literal : ty:: Const :: zero_sized ( tcx, func_ty) . into ( ) ,
425- } ) ;
425+ } ) ) ;
426426
427427 let ref_loc = self . make_place (
428428 Mutability :: Not ,
429429 tcx. mk_ref ( tcx. lifetimes . re_erased , ty:: TypeAndMut { ty, mutbl : hir:: Mutability :: Not } ) ,
430430 ) ;
431431
432432 // `let ref_loc: &ty = &src;`
433- let statement = self . make_statement ( StatementKind :: Assign ( box (
433+ let statement = self . make_statement ( StatementKind :: Assign ( Box :: new ( (
434434 ref_loc,
435435 Rvalue :: Ref ( tcx. lifetimes . re_erased , BorrowKind :: Shared , src) ,
436- ) ) ) ;
436+ ) ) ) ) ;
437437
438438 // `let loc = Clone::clone(ref_loc);`
439439 self . block (
@@ -461,10 +461,10 @@ impl CloneShimBuilder<'tcx> {
461461 let tcx = self . tcx ;
462462
463463 let cond = self . make_place ( Mutability :: Mut , tcx. types . bool ) ;
464- let compute_cond = self . make_statement ( StatementKind :: Assign ( box (
464+ let compute_cond = self . make_statement ( StatementKind :: Assign ( Box :: new ( (
465465 cond,
466- Rvalue :: BinaryOp ( BinOp :: Ne , box ( Operand :: Copy ( end) , Operand :: Copy ( beg) ) ) ,
467- ) ) ) ;
466+ Rvalue :: BinaryOp ( BinOp :: Ne , Box :: new ( ( Operand :: Copy ( end) , Operand :: Copy ( beg) ) ) ) ,
467+ ) ) ) ) ;
468468
469469 // `if end != beg { goto loop_body; } else { goto loop_end; }`
470470 self . block (
@@ -475,11 +475,11 @@ impl CloneShimBuilder<'tcx> {
475475 }
476476
477477 fn make_usize ( & self , value : u64 ) -> Box < Constant < ' tcx > > {
478- box Constant {
478+ Box :: new ( Constant {
479479 span : self . span ,
480480 user_ty : None ,
481481 literal : ty:: Const :: from_usize ( self . tcx , value) . into ( ) ,
482- }
482+ } )
483483 }
484484
485485 fn array_shim (
@@ -500,18 +500,18 @@ impl CloneShimBuilder<'tcx> {
500500 // `let end = len;`
501501 // `goto #1;`
502502 let inits = vec ! [
503- self . make_statement( StatementKind :: Assign ( box (
503+ self . make_statement( StatementKind :: Assign ( Box :: new ( (
504504 Place :: from( beg) ,
505505 Rvalue :: Use ( Operand :: Constant ( self . make_usize( 0 ) ) ) ,
506- ) ) ) ,
507- self . make_statement( StatementKind :: Assign ( box (
506+ ) ) ) ) ,
507+ self . make_statement( StatementKind :: Assign ( Box :: new ( (
508508 end,
509- Rvalue :: Use ( Operand :: Constant ( box Constant {
509+ Rvalue :: Use ( Operand :: Constant ( Box :: new ( Constant {
510510 span: self . span,
511511 user_ty: None ,
512512 literal: len. into( ) ,
513- } ) ) ,
514- ) ) ) ,
513+ } ) ) ) ,
514+ ) ) ) ) ,
515515 ] ;
516516 self . block ( inits, TerminatorKind :: Goto { target : BasicBlock :: new ( 1 ) } , false ) ;
517517
@@ -532,13 +532,13 @@ impl CloneShimBuilder<'tcx> {
532532 // BB #3
533533 // `beg = beg + 1;`
534534 // `goto #1`;
535- let statements = vec ! [ self . make_statement( StatementKind :: Assign ( box (
535+ let statements = vec ! [ self . make_statement( StatementKind :: Assign ( Box :: new ( (
536536 Place :: from( beg) ,
537537 Rvalue :: BinaryOp (
538538 BinOp :: Add ,
539- box ( Operand :: Copy ( Place :: from( beg) ) , Operand :: Constant ( self . make_usize( 1 ) ) ) ,
539+ Box :: new ( ( Operand :: Copy ( Place :: from( beg) ) , Operand :: Constant ( self . make_usize( 1 ) ) ) ) ,
540540 ) ,
541- ) ) ) ] ;
541+ ) ) ) ) ] ;
542542 self . block ( statements, TerminatorKind :: Goto { target : BasicBlock :: new ( 1 ) } , false ) ;
543543
544544 // BB #4
@@ -551,10 +551,10 @@ impl CloneShimBuilder<'tcx> {
551551 // goto #6;
552552 let end = beg;
553553 let beg = self . local_decls . push ( LocalDecl :: new ( tcx. types . usize , span) ) ;
554- let init = self . make_statement ( StatementKind :: Assign ( box (
554+ let init = self . make_statement ( StatementKind :: Assign ( Box :: new ( (
555555 Place :: from ( beg) ,
556556 Rvalue :: Use ( Operand :: Constant ( self . make_usize ( 0 ) ) ) ,
557- ) ) ) ;
557+ ) ) ) ) ;
558558 self . block ( vec ! [ init] , TerminatorKind :: Goto { target : BasicBlock :: new ( 6 ) } , true ) ;
559559
560560 // BB #6 (cleanup): loop {
@@ -585,13 +585,13 @@ impl CloneShimBuilder<'tcx> {
585585 // BB #8 (cleanup)
586586 // `beg = beg + 1;`
587587 // `goto #6;`
588- let statement = self . make_statement ( StatementKind :: Assign ( box (
588+ let statement = self . make_statement ( StatementKind :: Assign ( Box :: new ( (
589589 Place :: from ( beg) ,
590590 Rvalue :: BinaryOp (
591591 BinOp :: Add ,
592- box ( Operand :: Copy ( Place :: from ( beg) ) , Operand :: Constant ( self . make_usize ( 1 ) ) ) ,
592+ Box :: new ( ( Operand :: Copy ( Place :: from ( beg) ) , Operand :: Constant ( self . make_usize ( 1 ) ) ) ) ,
593593 ) ,
594- ) ) ) ;
594+ ) ) ) ) ;
595595 self . block ( vec ! [ statement] , TerminatorKind :: Goto { target : BasicBlock :: new ( 6 ) } , true ) ;
596596
597597 // BB #9 (resume)
@@ -748,10 +748,10 @@ fn build_call_shim<'tcx>(
748748 let borrow_kind = BorrowKind :: Mut { allow_two_phase_borrow : false } ;
749749 statements. push ( Statement {
750750 source_info,
751- kind : StatementKind :: Assign ( box (
751+ kind : StatementKind :: Assign ( Box :: new ( (
752752 Place :: from ( ref_rcvr) ,
753753 Rvalue :: Ref ( tcx. lifetimes . re_erased , borrow_kind, rcvr_place ( ) ) ,
754- ) ) ,
754+ ) ) ) ,
755755 } ) ;
756756 Operand :: Move ( Place :: from ( ref_rcvr) )
757757 }
@@ -765,11 +765,11 @@ fn build_call_shim<'tcx>(
765765 CallKind :: Direct ( def_id) => {
766766 let ty = tcx. type_of ( def_id) ;
767767 (
768- Operand :: Constant ( box Constant {
768+ Operand :: Constant ( Box :: new ( Constant {
769769 span,
770770 user_ty : None ,
771771 literal : ty:: Const :: zero_sized ( tcx, ty) . into ( ) ,
772- } ) ,
772+ } ) ) ,
773773 rcvr. into_iter ( ) . collect :: < Vec < _ > > ( ) ,
774774 )
775775 }
0 commit comments