@@ -230,11 +230,11 @@ fn split_block(
230
230
let block_data = & mut basic_blocks[ location. block ] ;
231
231
232
232
// Drain every statement after this one and move the current terminator to a new basic block.
233
- let new_block = BasicBlockData {
234
- statements : block_data. statements . split_off ( location. statement_index ) ,
235
- terminator : block_data. terminator . take ( ) ,
236
- is_cleanup : block_data. is_cleanup ,
237
- } ;
233
+ let new_block = BasicBlockData :: new_stmts (
234
+ block_data. statements . split_off ( location. statement_index ) ,
235
+ block_data. terminator . take ( ) ,
236
+ block_data. is_cleanup ,
237
+ ) ;
238
238
239
239
basic_blocks. push ( new_block)
240
240
}
@@ -270,10 +270,9 @@ fn insert_discr_cast_to_u128<'tcx>(
270
270
let mu_array =
271
271
local_decls. push ( LocalDecl :: with_source_info ( mu_array_ty, source_info) ) . into ( ) ;
272
272
let rvalue = Rvalue :: Cast ( CastKind :: Transmute , source_op, mu_array_ty) ;
273
- block_data. statements . push ( Statement {
274
- source_info,
275
- kind : StatementKind :: Assign ( Box :: new ( ( mu_array, rvalue) ) ) ,
276
- } ) ;
273
+ block_data
274
+ . statements
275
+ . push ( Statement :: new ( source_info, StatementKind :: Assign ( Box :: new ( ( mu_array, rvalue) ) ) ) ) ;
277
276
278
277
// Index into the array of MaybeUninit to get something that is actually
279
278
// as wide as the discriminant.
@@ -294,10 +293,10 @@ fn insert_discr_cast_to_u128<'tcx>(
294
293
let op_as_int =
295
294
local_decls. push ( LocalDecl :: with_source_info ( operand_int_ty, source_info) ) . into ( ) ;
296
295
let rvalue = Rvalue :: Cast ( CastKind :: Transmute , source_op, operand_int_ty) ;
297
- block_data. statements . push ( Statement {
296
+ block_data. statements . push ( Statement :: new (
298
297
source_info,
299
- kind : StatementKind :: Assign ( Box :: new ( ( op_as_int, rvalue) ) ) ,
300
- } ) ;
298
+ StatementKind :: Assign ( Box :: new ( ( op_as_int, rvalue) ) ) ,
299
+ ) ) ;
301
300
302
301
( CastKind :: IntToInt , Operand :: Copy ( op_as_int) )
303
302
} ;
@@ -306,18 +305,18 @@ fn insert_discr_cast_to_u128<'tcx>(
306
305
let rvalue = Rvalue :: Cast ( cast_kind, discr_ty_bits, discr. ty ) ;
307
306
let discr_in_discr_ty =
308
307
local_decls. push ( LocalDecl :: with_source_info ( discr. ty , source_info) ) . into ( ) ;
309
- block_data. statements . push ( Statement {
308
+ block_data. statements . push ( Statement :: new (
310
309
source_info,
311
- kind : StatementKind :: Assign ( Box :: new ( ( discr_in_discr_ty, rvalue) ) ) ,
312
- } ) ;
310
+ StatementKind :: Assign ( Box :: new ( ( discr_in_discr_ty, rvalue) ) ) ,
311
+ ) ) ;
313
312
314
313
// Cast the discriminant to a u128 (base for comparisions of enum discriminants).
315
314
let const_u128 = Ty :: new_uint ( tcx, ty:: UintTy :: U128 ) ;
316
315
let rvalue = Rvalue :: Cast ( CastKind :: IntToInt , Operand :: Copy ( discr_in_discr_ty) , const_u128) ;
317
316
let discr = local_decls. push ( LocalDecl :: with_source_info ( const_u128, source_info) ) . into ( ) ;
318
317
block_data
319
318
. statements
320
- . push ( Statement { source_info, kind : StatementKind :: Assign ( Box :: new ( ( discr, rvalue) ) ) } ) ;
319
+ . push ( Statement :: new ( source_info, StatementKind :: Assign ( Box :: new ( ( discr, rvalue) ) ) ) ) ;
321
320
322
321
discr
323
322
}
@@ -390,17 +389,17 @@ fn insert_uninhabited_enum_check<'tcx>(
390
389
) {
391
390
let is_ok: Place < ' _ > =
392
391
local_decls. push ( LocalDecl :: with_source_info ( tcx. types . bool , source_info) ) . into ( ) ;
393
- block_data. statements . push ( Statement {
392
+ block_data. statements . push ( Statement :: new (
394
393
source_info,
395
- kind : StatementKind :: Assign ( Box :: new ( (
394
+ StatementKind :: Assign ( Box :: new ( (
396
395
is_ok,
397
396
Rvalue :: Use ( Operand :: Constant ( Box :: new ( ConstOperand {
398
397
span : source_info. span ,
399
398
user_ty : None ,
400
399
const_ : Const :: Val ( ConstValue :: from_bool ( false ) , tcx. types . bool ) ,
401
400
} ) ) ) ,
402
401
) ) ) ,
403
- } ) ;
402
+ ) ) ;
404
403
405
404
block_data. terminator = Some ( Terminator {
406
405
source_info,
@@ -463,27 +462,27 @@ fn insert_niche_check<'tcx>(
463
462
464
463
let discr_diff: Place < ' _ > =
465
464
local_decls. push ( LocalDecl :: with_source_info ( tcx. types . u128 , source_info) ) . into ( ) ;
466
- block_data. statements . push ( Statement {
465
+ block_data. statements . push ( Statement :: new (
467
466
source_info,
468
- kind : StatementKind :: Assign ( Box :: new ( (
467
+ StatementKind :: Assign ( Box :: new ( (
469
468
discr_diff,
470
469
Rvalue :: BinaryOp ( BinOp :: Sub , Box :: new ( ( Operand :: Copy ( discr) , start_const) ) ) ,
471
470
) ) ) ,
472
- } ) ;
471
+ ) ) ;
473
472
474
473
let is_ok: Place < ' _ > =
475
474
local_decls. push ( LocalDecl :: with_source_info ( tcx. types . bool , source_info) ) . into ( ) ;
476
- block_data. statements . push ( Statement {
475
+ block_data. statements . push ( Statement :: new (
477
476
source_info,
478
- kind : StatementKind :: Assign ( Box :: new ( (
477
+ StatementKind :: Assign ( Box :: new ( (
479
478
is_ok,
480
479
Rvalue :: BinaryOp (
481
480
// This is a `WrappingRange`, so make sure to get the wrapping right.
482
481
BinOp :: Le ,
483
482
Box :: new ( ( Operand :: Copy ( discr_diff) , end_start_diff_const) ) ,
484
483
) ,
485
484
) ) ) ,
486
- } ) ;
485
+ ) ) ;
487
486
488
487
block_data. terminator = Some ( Terminator {
489
488
source_info,
0 commit comments