@@ -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 { .. }
@@ -327,7 +329,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
327329 block,
328330 source_info,
329331 result_value,
330- Rvalue :: CheckedBinaryOp ( op, box ( lhs. to_copy ( ) , rhs. to_copy ( ) ) ) ,
332+ Rvalue :: CheckedBinaryOp ( op, Box :: new ( ( lhs. to_copy ( ) , rhs. to_copy ( ) ) ) ) ,
331333 ) ;
332334 let val_fld = Field :: new ( 0 ) ;
333335 let of_fld = Field :: new ( 1 ) ;
@@ -360,7 +362,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
360362 block,
361363 source_info,
362364 is_zero,
363- Rvalue :: BinaryOp ( BinOp :: Eq , box ( rhs. to_copy ( ) , zero) ) ,
365+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( rhs. to_copy ( ) , zero) ) ) ,
364366 ) ;
365367
366368 block = self . assert ( block, Operand :: Move ( is_zero) , false , zero_err, span) ;
@@ -381,13 +383,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
381383 block,
382384 source_info,
383385 is_neg_1,
384- Rvalue :: BinaryOp ( BinOp :: Eq , box ( rhs. to_copy ( ) , neg_1) ) ,
386+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( rhs. to_copy ( ) , neg_1) ) ) ,
385387 ) ;
386388 self . cfg . push_assign (
387389 block,
388390 source_info,
389391 is_min,
390- Rvalue :: BinaryOp ( BinOp :: Eq , box ( lhs. to_copy ( ) , min) ) ,
392+ Rvalue :: BinaryOp ( BinOp :: Eq , Box :: new ( ( lhs. to_copy ( ) , min) ) ) ,
391393 ) ;
392394
393395 let is_neg_1 = Operand :: Move ( is_neg_1) ;
@@ -396,14 +398,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
396398 block,
397399 source_info,
398400 of,
399- Rvalue :: BinaryOp ( BinOp :: BitAnd , box ( is_neg_1, is_min) ) ,
401+ Rvalue :: BinaryOp ( BinOp :: BitAnd , Box :: new ( ( is_neg_1, is_min) ) ) ,
400402 ) ;
401403
402404 block = self . assert ( block, Operand :: Move ( of) , false , overflow_err, span) ;
403405 }
404406 }
405407
406- block. and ( Rvalue :: BinaryOp ( op, box ( lhs, rhs) ) )
408+ block. and ( Rvalue :: BinaryOp ( op, Box :: new ( ( lhs, rhs) ) ) )
407409 }
408410 }
409411
0 commit comments