about summary refs log tree commit diff
diff options
context:
space:
mode:
authorusamoi <usamoi@outlook.com>2025-06-02 07:26:52 +0800
committerusamoi <usamoi@outlook.com>2025-06-02 08:00:15 +0800
commitd948907f8093d7a9cb22c489e5d7afe6721730e2 (patch)
tree197b69c8b6e9322ee3db60bce5a8dd7a08b34c8b
parent99e7c15e81385b38a8186b51edc4577d5d7b5bdd (diff)
downloadrust-d948907f8093d7a9cb22c489e5d7afe6721730e2.tar.gz
rust-d948907f8093d7a9cb22c489e5d7afe6721730e2.zip
add f16_epsilon and f128_epsilon
-rw-r--r--compiler/rustc_span/src/symbol.rs2
-rw-r--r--library/core/src/num/f128.rs1
-rw-r--r--library/core/src/num/f16.rs1
3 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 970faf2997c..4e842a8f93a 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -937,8 +937,10 @@ symbols! {
         external_doc,
         f,
         f128,
+        f128_epsilon,
         f128_nan,
         f16,
+        f16_epsilon,
         f16_nan,
         f16c_target_feature,
         f32,
diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs
index 6b9b2ba8689..58de62a8be8 100644
--- a/library/core/src/num/f128.rs
+++ b/library/core/src/num/f128.rs
@@ -171,6 +171,7 @@ impl f128 {
     /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
     /// [`MANTISSA_DIGITS`]: f128::MANTISSA_DIGITS
     #[unstable(feature = "f128", issue = "116909")]
+    #[rustc_diagnostic_item = "f128_epsilon"]
     pub const EPSILON: f128 = 1.92592994438723585305597794258492732e-34_f128;
 
     /// Smallest finite `f128` value.
diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs
index eb7af993c60..45f402d4967 100644
--- a/library/core/src/num/f16.rs
+++ b/library/core/src/num/f16.rs
@@ -168,6 +168,7 @@ impl f16 {
     /// [Machine epsilon]: https://en.wikipedia.org/wiki/Machine_epsilon
     /// [`MANTISSA_DIGITS`]: f16::MANTISSA_DIGITS
     #[unstable(feature = "f16", issue = "116909")]
+    #[rustc_diagnostic_item = "f16_epsilon"]
     pub const EPSILON: f16 = 9.7656e-4_f16;
 
     /// Smallest finite `f16` value.