1
Fork 0

Auto merge of #127496 - tgross35:f16-f128-pattern-fixme, r=Nadrieril

Update `f16`/`f128` FIXMEs that needed `(NEG_)INFINITY`

Just a small fix to the pattern matching tests now that we can. Also contains a small unrelated comment tweak.
This commit is contained in:
bors 2024-07-10 04:20:32 +00:00
commit 7caf6726db
4 changed files with 53 additions and 40 deletions

View file

@ -563,7 +563,8 @@ fn lint_literal<'tcx>(
ty::Float(t) => {
let is_infinite = match lit.node {
ast::LitKind::Float(v, _) => match t {
// FIXME(f16_f128): add this check once we have library support
// FIXME(f16_f128): add this check once `is_infinite` is reliable (ABI
// issues resolved).
ty::FloatTy::F16 => Ok(false),
ty::FloatTy::F32 => v.as_str().parse().map(f32::is_infinite),
ty::FloatTy::F64 => v.as_str().parse().map(f64::is_infinite),