From 6c13e3b5434424b65c6f096e2955cad5a8e0e62e Mon Sep 17 00:00:00 2001 From: Urgau Date: Sat, 20 May 2023 11:28:25 +0200 Subject: [PATCH] Add diagnostic items for `f32::NAN` and `f64::NAN` --- core/src/num/f32.rs | 1 + core/src/num/f64.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/core/src/num/f32.rs b/core/src/num/f32.rs index 4a035ad61..d050d21c8 100644 --- a/core/src/num/f32.rs +++ b/core/src/num/f32.rs @@ -403,6 +403,7 @@ impl f32 { /// and the stability of its representation over Rust versions /// and target platforms isn't guaranteed. #[stable(feature = "assoc_int_consts", since = "1.43.0")] + #[rustc_diagnostic_item = "f32_nan"] pub const NAN: f32 = 0.0_f32 / 0.0_f32; /// Infinity (∞). #[stable(feature = "assoc_int_consts", since = "1.43.0")] diff --git a/core/src/num/f64.rs b/core/src/num/f64.rs index 3aafc435f..d9a738191 100644 --- a/core/src/num/f64.rs +++ b/core/src/num/f64.rs @@ -401,6 +401,7 @@ impl f64 { /// This constant isn't guaranteed to equal to any specific NaN bitpattern, /// and the stability of its representation over Rust versions /// and target platforms isn't guaranteed. + #[rustc_diagnostic_item = "f64_nan"] #[stable(feature = "assoc_int_consts", since = "1.43.0")] pub const NAN: f64 = 0.0_f64 / 0.0_f64; /// Infinity (∞).