about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstd/f32.rs3
-rw-r--r--src/libstd/f64.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/f32.rs b/src/libstd/f32.rs
index 142558a9f0a..aefe4690b10 100644
--- a/src/libstd/f32.rs
+++ b/src/libstd/f32.rs
@@ -1015,7 +1015,8 @@ impl f32 {
     /// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
     /// assert!((std::f32::NAN).clamp(-2.0, 1.0).is_nan());
     /// ```
-    #[must_use = "method returns a new number and does not mutate the original value"]
+    // The tests below invoke `clamp` without a return value in order to cause a `panic`.
+    // #[must_use = "method returns a new number and does not mutate the original value"]
     #[unstable(feature = "clamp", issue = "44095")]
     #[inline]
     pub fn clamp(self, min: f32, max: f32) -> f32 {
diff --git a/src/libstd/f64.rs b/src/libstd/f64.rs
index d46cef149f1..0eca1434a63 100644
--- a/src/libstd/f64.rs
+++ b/src/libstd/f64.rs
@@ -936,6 +936,8 @@ impl f64 {
     /// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
     /// assert!((std::f64::NAN).clamp(-2.0, 1.0).is_nan());
     /// ```
+    // The tests below invoke `clamp` without a return value in order to cause a `panic`.
+    // #[must_use = "method returns a new number and does not mutate the original value"]
     #[unstable(feature = "clamp", issue = "44095")]
     #[inline]
     pub fn clamp(self, min: f64, max: f64) -> f64 {