File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -870,10 +870,10 @@ pub fn mir_to_const<'tcx>(tcx: TyCtxt<'tcx>, result: mir::Const<'tcx>) -> Option
870870 let range = alloc_range ( offset + size * idx, size) ;
871871 let val = alloc. read_scalar ( & tcx, range, /* read_provenance */ false ) . ok ( ) ?;
872872 res. push ( match flt {
873- FloatTy :: F16 => Constant :: F16 ( f16:: from_bits ( val. to_u16 ( ) . ok ( ) ?) ) ,
874- FloatTy :: F32 => Constant :: F32 ( f32:: from_bits ( val. to_u32 ( ) . ok ( ) ?) ) ,
875- FloatTy :: F64 => Constant :: F64 ( f64:: from_bits ( val. to_u64 ( ) . ok ( ) ?) ) ,
876- FloatTy :: F128 => Constant :: F128 ( f128:: from_bits ( val. to_u128 ( ) . ok ( ) ?) ) ,
873+ FloatTy :: F16 => Constant :: F16 ( f16:: from_bits ( val. to_u16 ( ) . discard_err ( ) ?) ) ,
874+ FloatTy :: F32 => Constant :: F32 ( f32:: from_bits ( val. to_u32 ( ) . discard_err ( ) ?) ) ,
875+ FloatTy :: F64 => Constant :: F64 ( f64:: from_bits ( val. to_u64 ( ) . discard_err ( ) ?) ) ,
876+ FloatTy :: F128 => Constant :: F128 ( f128:: from_bits ( val. to_u128 ( ) . discard_err ( ) ?) ) ,
877877 } ) ;
878878 }
879879 Some ( Constant :: Vec ( res) )
@@ -903,7 +903,7 @@ fn mir_is_empty<'tcx>(tcx: TyCtxt<'tcx>, result: mir::Const<'tcx>) -> Option<boo
903903 . read_scalar ( & tcx, alloc_range ( offset + ptr_size, ptr_size) , false )
904904 . ok ( ) ?
905905 . to_target_usize ( & tcx)
906- . ok ( ) ?;
906+ . discard_err ( ) ?;
907907 Some ( len == 0 )
908908 } else {
909909 None
You can’t perform that action at this time.
0 commit comments