@@ -829,40 +829,15 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
829829 fx. bcx . ins ( ) . nop ( ) ;
830830 }
831831 }
832- Rvalue :: NullaryOp ( ref null_op, ty ) => {
832+ Rvalue :: NullaryOp ( ref null_op) => {
833833 assert ! ( lval. layout( ) . ty. is_sized( fx. tcx, fx. typing_env( ) ) ) ;
834- let layout = fx. layout_of ( fx. monomorphize ( ty) ) ;
835834 let val = match null_op {
836- NullOp :: OffsetOf ( fields) => fx
837- . tcx
838- . offset_of_subfield (
839- ty:: TypingEnv :: fully_monomorphized ( ) ,
840- layout,
841- fields. iter ( ) ,
842- )
843- . bytes ( ) ,
844- NullOp :: UbChecks => {
845- let val = fx. tcx . sess . ub_checks ( ) ;
846- let val = CValue :: by_val (
847- fx. bcx . ins ( ) . iconst ( types:: I8 , i64:: from ( val) ) ,
848- fx. layout_of ( fx. tcx . types . bool ) ,
849- ) ;
850- lval. write_cvalue ( fx, val) ;
851- return ;
852- }
853- NullOp :: ContractChecks => {
854- let val = fx. tcx . sess . contract_checks ( ) ;
855- let val = CValue :: by_val (
856- fx. bcx . ins ( ) . iconst ( types:: I8 , i64:: from ( val) ) ,
857- fx. layout_of ( fx. tcx . types . bool ) ,
858- ) ;
859- lval. write_cvalue ( fx, val) ;
860- return ;
861- }
835+ NullOp :: UbChecks => fx. tcx . sess . ub_checks ( ) ,
836+ NullOp :: ContractChecks => fx. tcx . sess . contract_checks ( ) ,
862837 } ;
863838 let val = CValue :: by_val (
864- fx. bcx . ins ( ) . iconst ( fx . pointer_type , i64:: try_from ( val) . unwrap ( ) ) ,
865- fx. layout_of ( fx. tcx . types . usize ) ,
839+ fx. bcx . ins ( ) . iconst ( types :: I8 , i64:: from ( val) ) ,
840+ fx. layout_of ( fx. tcx . types . bool ) ,
866841 ) ;
867842 lval. write_cvalue ( fx, val) ;
868843 }
0 commit comments