Add diagnostic items for `f32::NAN` and `f64::NAN`

This commit is contained in:
Urgau 2023-05-20 11:28:25 +02:00
parent d7ad9d9797
commit 3681285df7
3 changed files with 4 additions and 0 deletions

View File

@ -701,7 +701,9 @@ symbols! {
f,
f16c_target_feature,
f32,
f32_nan,
f64,
f64_nan,
fabsf32,
fabsf64,
fadd_fast,

View File

@ -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")]

View File

@ -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 (∞).