1
Fork 0

Replace f16 and f128 pattern matching stubs with real implementations

This section of code depends on `rustc_apfloat` rather than our internal
types, so this is one potential ICE that we should be able to melt now.

This also fixes some missing range and match handling in `rustc_middle`.
This commit is contained in:
Trevor Gross 2024-03-26 06:01:09 -04:00
parent acb62737ac
commit 6fb6c19c96
11 changed files with 311 additions and 40 deletions

View file

@ -369,10 +369,10 @@ impl<'tcx> ConstToPat<'tcx> {
ty::Float(flt) => {
let v = cv.unwrap_leaf();
let is_nan = match flt {
ty::FloatTy::F16 => unimplemented!("f16_f128"),
ty::FloatTy::F16 => v.to_f16().is_nan(),
ty::FloatTy::F32 => v.to_f32().is_nan(),
ty::FloatTy::F64 => v.to_f64().is_nan(),
ty::FloatTy::F128 => unimplemented!("f16_f128"),
ty::FloatTy::F128 => v.to_f128().is_nan(),
};
if is_nan {
// NaNs are not ever equal to anything so they make no sense as patterns.