@@ -708,30 +708,6 @@ fn codegen_stmt<'tcx>(
708
708
let operand = operand. load_scalar ( fx) ;
709
709
lval. write_cvalue ( fx, CValue :: by_val ( operand, box_layout) ) ;
710
710
}
711
- Rvalue :: NullaryOp ( NullOp :: Box , content_ty) => {
712
- let usize_type = fx. clif_type ( fx. tcx . types . usize ) . unwrap ( ) ;
713
- let content_ty = fx. monomorphize ( content_ty) ;
714
- let layout = fx. layout_of ( content_ty) ;
715
- let llsize = fx. bcx . ins ( ) . iconst ( usize_type, layout. size . bytes ( ) as i64 ) ;
716
- let llalign = fx. bcx . ins ( ) . iconst ( usize_type, layout. align . abi . bytes ( ) as i64 ) ;
717
- let box_layout = fx. layout_of ( fx. tcx . mk_box ( content_ty) ) ;
718
-
719
- // Allocate space:
720
- let def_id =
721
- match fx. tcx . lang_items ( ) . require ( rustc_hir:: LangItem :: ExchangeMalloc ) {
722
- Ok ( id) => id,
723
- Err ( s) => {
724
- fx. tcx
725
- . sess
726
- . fatal ( & format ! ( "allocation of `{}` {}" , box_layout. ty, s) ) ;
727
- }
728
- } ;
729
- let instance = ty:: Instance :: mono ( fx. tcx , def_id) . polymorphize ( fx. tcx ) ;
730
- let func_ref = fx. get_function_ref ( instance) ;
731
- let call = fx. bcx . ins ( ) . call ( func_ref, & [ llsize, llalign] ) ;
732
- let ptr = fx. bcx . inst_results ( call) [ 0 ] ;
733
- lval. write_cvalue ( fx, CValue :: by_val ( ptr, box_layout) ) ;
734
- }
735
711
Rvalue :: NullaryOp ( null_op, ty) => {
736
712
assert ! (
737
713
lval. layout( )
@@ -742,7 +718,6 @@ fn codegen_stmt<'tcx>(
742
718
let val = match null_op {
743
719
NullOp :: SizeOf => layout. size . bytes ( ) ,
744
720
NullOp :: AlignOf => layout. align . abi . bytes ( ) ,
745
- NullOp :: Box => unreachable ! ( ) ,
746
721
} ;
747
722
let val =
748
723
CValue :: const_val ( fx, fx. layout_of ( fx. tcx . types . usize ) , val. into ( ) ) ;
0 commit comments