@@ -715,30 +715,6 @@ fn codegen_stmt<'tcx>(
715
715
let operand = operand. load_scalar ( fx) ;
716
716
lval. write_cvalue ( fx, CValue :: by_val ( operand, box_layout) ) ;
717
717
}
718
- Rvalue :: NullaryOp ( NullOp :: Box , content_ty) => {
719
- let usize_type = fx. clif_type ( fx. tcx . types . usize ) . unwrap ( ) ;
720
- let content_ty = fx. monomorphize ( content_ty) ;
721
- let layout = fx. layout_of ( content_ty) ;
722
- let llsize = fx. bcx . ins ( ) . iconst ( usize_type, layout. size . bytes ( ) as i64 ) ;
723
- let llalign = fx. bcx . ins ( ) . iconst ( usize_type, layout. align . abi . bytes ( ) as i64 ) ;
724
- let box_layout = fx. layout_of ( fx. tcx . mk_box ( content_ty) ) ;
725
-
726
- // Allocate space:
727
- let def_id =
728
- match fx. tcx . lang_items ( ) . require ( rustc_hir:: LangItem :: ExchangeMalloc ) {
729
- Ok ( id) => id,
730
- Err ( s) => {
731
- fx. tcx
732
- . sess
733
- . fatal ( & format ! ( "allocation of `{}` {}" , box_layout. ty, s) ) ;
734
- }
735
- } ;
736
- let instance = ty:: Instance :: mono ( fx. tcx , def_id) . polymorphize ( fx. tcx ) ;
737
- let func_ref = fx. get_function_ref ( instance) ;
738
- let call = fx. bcx . ins ( ) . call ( func_ref, & [ llsize, llalign] ) ;
739
- let ptr = fx. bcx . inst_results ( call) [ 0 ] ;
740
- lval. write_cvalue ( fx, CValue :: by_val ( ptr, box_layout) ) ;
741
- }
742
718
Rvalue :: NullaryOp ( null_op, ty) => {
743
719
assert ! (
744
720
lval. layout( )
@@ -749,7 +725,6 @@ fn codegen_stmt<'tcx>(
749
725
let val = match null_op {
750
726
NullOp :: SizeOf => layout. size . bytes ( ) ,
751
727
NullOp :: AlignOf => layout. align . abi . bytes ( ) ,
752
- NullOp :: Box => unreachable ! ( ) ,
753
728
} ;
754
729
let val = CValue :: const_val ( fx, fx. layout_of ( fx. tcx . types . usize ) , val. into ( ) ) ;
755
730
lval. write_cvalue ( fx, val) ;
@@ -774,18 +749,6 @@ fn codegen_stmt<'tcx>(
774
749
| StatementKind :: Retag { .. }
775
750
| StatementKind :: AscribeUserType ( ..) => { }
776
751
777
- StatementKind :: LlvmInlineAsm ( asm) => {
778
- match asm. asm . asm . as_str ( ) . trim ( ) {
779
- "" => {
780
- // Black box
781
- }
782
- _ => fx. tcx . sess . span_fatal (
783
- stmt. source_info . span ,
784
- "Legacy `llvm_asm!` inline assembly is not supported. \
785
- Try using the new `asm!` instead.",
786
- ) ,
787
- }
788
- }
789
752
StatementKind :: Coverage { .. } => fx. tcx . sess . fatal ( "-Zcoverage is unimplemented" ) ,
790
753
StatementKind :: CopyNonOverlapping ( inner) => {
791
754
let dst = codegen_operand ( fx, & inner. dst ) ;
0 commit comments