Rollup merge of #132439 - tgross35:f16-f128-nan-lint, r=jieyouxu
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:
commit
2896483320
6 changed files with 299 additions and 30 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue