@@ -487,20 +487,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
487
487
)
488
488
}
489
489
490
- mir:: Rvalue :: NullaryOp ( mir:: NullOp :: SizeOf , ty) => {
491
- let ty = self . monomorphize ( ty) ;
492
- assert ! ( bx. cx( ) . type_is_sized( ty) ) ;
493
- let val = bx. cx ( ) . const_usize ( bx. cx ( ) . layout_of ( ty) . size . bytes ( ) ) ;
494
- let tcx = self . cx . tcx ( ) ;
495
- (
496
- bx,
497
- OperandRef {
498
- val : OperandValue :: Immediate ( val) ,
499
- layout : self . cx . layout_of ( tcx. types . usize ) ,
500
- } ,
501
- )
502
- }
503
-
504
490
mir:: Rvalue :: NullaryOp ( mir:: NullOp :: Box , content_ty) => {
505
491
let content_ty = self . monomorphize ( content_ty) ;
506
492
let content_layout = bx. cx ( ) . layout_of ( content_ty) ;
@@ -525,6 +511,27 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
525
511
let operand = OperandRef { val : OperandValue :: Immediate ( val) , layout : box_layout } ;
526
512
( bx, operand)
527
513
}
514
+
515
+ mir:: Rvalue :: NullaryOp ( null_op, ty) => {
516
+ let ty = self . monomorphize ( ty) ;
517
+ assert ! ( bx. cx( ) . type_is_sized( ty) ) ;
518
+ let layout = bx. cx ( ) . layout_of ( ty) ;
519
+ let val = match null_op {
520
+ mir:: NullOp :: SizeOf => layout. size . bytes ( ) ,
521
+ mir:: NullOp :: AlignOf => layout. align . abi . bytes ( ) ,
522
+ mir:: NullOp :: Box => unreachable ! ( ) ,
523
+ } ;
524
+ let val = bx. cx ( ) . const_usize ( val) ;
525
+ let tcx = self . cx . tcx ( ) ;
526
+ (
527
+ bx,
528
+ OperandRef {
529
+ val : OperandValue :: Immediate ( val) ,
530
+ layout : self . cx . layout_of ( tcx. types . usize ) ,
531
+ } ,
532
+ )
533
+ }
534
+
528
535
mir:: Rvalue :: ThreadLocalRef ( def_id) => {
529
536
assert ! ( bx. cx( ) . tcx( ) . is_static( def_id) ) ;
530
537
let static_ = bx. get_static ( def_id) ;
0 commit comments