Skip to content

Commit 3681285

Browse files
committed
Add diagnostic items for f32::NAN and f64::NAN
1 parent d7ad9d9 commit 3681285

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,9 @@ symbols! {
701701
f,
702702
f16c_target_feature,
703703
f32,
704+
f32_nan,
704705
f64,
706+
f64_nan,
705707
fabsf32,
706708
fabsf64,
707709
fadd_fast,

library/core/src/num/f32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ impl f32 {
403403
/// and the stability of its representation over Rust versions
404404
/// and target platforms isn't guaranteed.
405405
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
406+
#[rustc_diagnostic_item = "f32_nan"]
406407
pub const NAN: f32 = 0.0_f32 / 0.0_f32;
407408
/// Infinity (∞).
408409
#[stable(feature = "assoc_int_consts", since = "1.43.0")]

library/core/src/num/f64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ impl f64 {
401401
/// This constant isn't guaranteed to equal to any specific NaN bitpattern,
402402
/// and the stability of its representation over Rust versions
403403
/// and target platforms isn't guaranteed.
404+
#[rustc_diagnostic_item = "f64_nan"]
404405
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
405406
pub const NAN: f64 = 0.0_f64 / 0.0_f64;
406407
/// Infinity (∞).

0 commit comments

Comments
 (0)