about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2023-05-20 11:28:25 +0200
committerUrgau <urgau@numericable.fr>2023-06-09 17:46:33 +0200
commit3681285df77af155fe0f34c64226f4ea89c7150b (patch)
tree6e060fb47f46326b78530df4be614f26d97cee8b /library
parentd7ad9d9797e595e9daed98c291a8eb6e4be838ff (diff)
downloadrust-3681285df77af155fe0f34c64226f4ea89c7150b.tar.gz
rust-3681285df77af155fe0f34c64226f4ea89c7150b.zip
Add diagnostic items for `f32::NAN` and `f64::NAN`
Diffstat (limited to 'library')
-rw-r--r--library/core/src/num/f32.rs1
-rw-r--r--library/core/src/num/f64.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/num/f32.rs b/library/core/src/num/f32.rs
index 4a035ad61e1..d050d21c8c5 100644
--- a/library/core/src/num/f32.rs
+++ b/library/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/library/core/src/num/f64.rs b/library/core/src/num/f64.rs
index 3aafc435f1e..d9a738191f7 100644
--- a/library/core/src/num/f64.rs
+++ b/library/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 (∞).