1
Fork 0

Add f16 and f128 to invalid_nan_comparison

Currently `f32_nan` and `f64_nan` are used to provide the
`invalid_nan_comparison` lint. Since we have `f16_nan` and `f128_nan`,
hook these up so the new float types get the same lints.
This commit is contained in:
Trevor Gross 2024-10-31 21:24:31 -05:00
parent 24254efb43
commit 3afbe4f9c7
6 changed files with 299 additions and 30 deletions

View file

@ -204,7 +204,10 @@ fn lint_nan<'tcx>(
return false;
};
matches!(cx.tcx.get_diagnostic_name(def_id), Some(sym::f32_nan | sym::f64_nan))
matches!(
cx.tcx.get_diagnostic_name(def_id),
Some(sym::f16_nan | sym::f32_nan | sym::f64_nan | sym::f128_nan)
)
}
_ => false,
}