@@ -73,7 +73,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
7373 block,
7474 source_info,
7575 is_min,
76- Rvalue :: BinaryOp ( BinOp :: Eq , box ( arg. to_copy ( ) , minval) ) ,
76+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( arg. to_copy ( ) , minval) ) ) ,
7777 ) ;
7878
7979 block = this. assert (
@@ -158,7 +158,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
158158 . map ( |f| unpack ! ( block = this. as_operand( block, scope, & this. thir[ f] ) ) )
159159 . collect ( ) ;
160160
161- block. and ( Rvalue :: Aggregate ( box AggregateKind :: Array ( el_ty) , fields) )
161+ block. and ( Rvalue :: Aggregate ( Box :: new ( AggregateKind :: Array ( el_ty) ) , fields) )
162162 }
163163 ExprKind :: Tuple { ref fields } => {
164164 // see (*) above
@@ -169,7 +169,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
169169 . map ( |f| unpack ! ( block = this. as_operand( block, scope, & this. thir[ f] ) ) )
170170 . collect ( ) ;
171171
172- block. and ( Rvalue :: Aggregate ( box AggregateKind :: Tuple , fields) )
172+ block. and ( Rvalue :: Aggregate ( Box :: new ( AggregateKind :: Tuple ) , fields) )
173173 }
174174 ExprKind :: Closure { closure_id, substs, ref upvars, movability, ref fake_reads } => {
175175 // Convert the closure fake reads, if any, from `ExprRef` to mir `Place`
@@ -254,19 +254,21 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
254254 // We implicitly set the discriminant to 0. See
255255 // librustc_mir/transform/deaggregator.rs for details.
256256 let movability = movability. unwrap ( ) ;
257- box AggregateKind :: Generator ( closure_id, substs, movability)
257+ Box :: new ( AggregateKind :: Generator ( closure_id, substs, movability) )
258+ }
259+ UpvarSubsts :: Closure ( substs) => {
260+ Box :: new ( AggregateKind :: Closure ( closure_id, substs) )
258261 }
259- UpvarSubsts :: Closure ( substs) => box AggregateKind :: Closure ( closure_id, substs) ,
260262 } ;
261263 block. and ( Rvalue :: Aggregate ( result, operands) )
262264 }
263265 ExprKind :: Assign { .. } | ExprKind :: AssignOp { .. } => {
264266 block = unpack ! ( this. stmt_expr( block, expr, None ) ) ;
265- block. and ( Rvalue :: Use ( Operand :: Constant ( box Constant {
267+ block. and ( Rvalue :: Use ( Operand :: Constant ( Box :: new ( Constant {
266268 span : expr_span,
267269 user_ty : None ,
268270 literal : ty:: Const :: zero_sized ( this. tcx , this. tcx . types . unit ) . into ( ) ,
269- } ) ) )
271+ } ) ) ) )
270272 }
271273 ExprKind :: Yield { .. }
272274 | ExprKind :: Literal { .. }
@@ -326,7 +328,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
326328 block,
327329 source_info,
328330 result_value,
329- Rvalue :: CheckedBinaryOp ( op, box ( lhs. to_copy ( ) , rhs. to_copy ( ) ) ) ,
331+ Rvalue :: CheckedBinaryOp ( op, Box :: new ( ( lhs. to_copy ( ) , rhs. to_copy ( ) ) ) ) ,
330332 ) ;
331333 let val_fld = Field :: new ( 0 ) ;
332334 let of_fld = Field :: new ( 1 ) ;
@@ -359,7 +361,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
359361 block,
360362 source_info,
361363 is_zero,
362- Rvalue :: BinaryOp ( BinOp :: Eq , box ( rhs. to_copy ( ) , zero) ) ,
364+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( rhs. to_copy ( ) , zero) ) ) ,
363365 ) ;
364366
365367 block = self . assert ( block, Operand :: Move ( is_zero) , false , zero_err, span) ;
@@ -380,13 +382,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
380382 block,
381383 source_info,
382384 is_neg_1,
383- Rvalue :: BinaryOp ( BinOp :: Eq , box ( rhs. to_copy ( ) , neg_1) ) ,
385+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( rhs. to_copy ( ) , neg_1) ) ) ,
384386 ) ;
385387 self . cfg . push_assign (
386388 block,
387389 source_info,
388390 is_min,
389- Rvalue :: BinaryOp ( BinOp :: Eq , box ( lhs. to_copy ( ) , min) ) ,
391+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( lhs. to_copy ( ) , min) ) ) ,
390392 ) ;
391393
392394 let is_neg_1 = Operand :: Move ( is_neg_1) ;
@@ -395,14 +397,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
395397 block,
396398 source_info,
397399 of,
398- Rvalue :: BinaryOp ( BinOp :: BitAnd , box ( is_neg_1, is_min) ) ,
400+ Rvalue :: BinaryOp ( BinOp :: BitAnd , Box :: new ( ( is_neg_1, is_min) ) ) ,
399401 ) ;
400402
401403 block = self . assert ( block, Operand :: Move ( of) , false , overflow_err, span) ;
402404 }
403405 }
404406
405- block. and ( Rvalue :: BinaryOp ( op, box ( lhs, rhs) ) )
407+ block. and ( Rvalue :: BinaryOp ( op, Box :: new ( ( lhs, rhs) ) ) )
406408 }
407409 }
408410
0 commit comments