@@ -853,31 +853,14 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
853853 fx. bcx . ins ( ) . nop ( ) ;
854854 }
855855 }
856- Rvalue :: NullaryOp ( ref null_op, ty ) => {
856+ Rvalue :: NullaryOp ( ref null_op) => {
857857 assert ! ( lval. layout( ) . ty. is_sized( fx. tcx, fx. typing_env( ) ) ) ;
858- let layout = fx. layout_of ( fx. monomorphize ( ty) ) ;
859858 let val = match null_op {
860- NullOp :: OffsetOf ( fields) => fx
861- . tcx
862- . offset_of_subfield (
863- ty:: TypingEnv :: fully_monomorphized ( ) ,
864- layout,
865- fields. iter ( ) ,
866- )
867- . bytes ( ) ,
868- NullOp :: RuntimeChecks ( kind) => {
869- let val = kind. value ( fx. tcx . sess ) ;
870- let val = CValue :: by_val (
871- fx. bcx . ins ( ) . iconst ( types:: I8 , i64:: from ( val) ) ,
872- fx. layout_of ( fx. tcx . types . bool ) ,
873- ) ;
874- lval. write_cvalue ( fx, val) ;
875- return ;
876- }
859+ NullOp :: RuntimeChecks ( kind) => kind. value ( fx. tcx . sess ) ,
877860 } ;
878861 let val = CValue :: by_val (
879- fx. bcx . ins ( ) . iconst ( fx . pointer_type , i64:: try_from ( val) . unwrap ( ) ) ,
880- fx. layout_of ( fx. tcx . types . usize ) ,
862+ fx. bcx . ins ( ) . iconst ( types :: I8 , i64:: from ( val) ) ,
863+ fx. layout_of ( fx. tcx . types . bool ) ,
881864 ) ;
882865 lval. write_cvalue ( fx, val) ;
883866 }
0 commit comments