File tree 1 file changed +5
-5
lines changed
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
870
870
let range = alloc_range ( offset + size * idx, size) ;
871
871
let val = alloc. read_scalar ( & tcx, range, /* read_provenance */ false ) . ok ( ) ?;
872
872
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 ( ) ?) ) ,
877
877
} ) ;
878
878
}
879
879
Some ( Constant :: Vec ( res) )
@@ -903,7 +903,7 @@ fn mir_is_empty<'tcx>(tcx: TyCtxt<'tcx>, result: mir::Const<'tcx>) -> Option<boo
903
903
. read_scalar ( & tcx, alloc_range ( offset + ptr_size, ptr_size) , false )
904
904
. ok ( ) ?
905
905
. to_target_usize ( & tcx)
906
- . ok ( ) ?;
906
+ . discard_err ( ) ?;
907
907
Some ( len == 0 )
908
908
} else {
909
909
None
You can’t perform that action at this time.
0 commit comments