Skip to content

Commit

Permalink
Add diagnostic items for f32::NAN and f64::NAN
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Jun 9, 2023
1 parent 46e7e94 commit 6c13e3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
1 change: 1 addition & 0 deletions core/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (∞).
Expand Down

0 comments on commit 6c13e3b

Please sign in to comment.