File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1015,7 +1015,8 @@ impl f32 {
10151015 /// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
10161016 /// assert!((std::f32::NAN).clamp(-2.0, 1.0).is_nan());
10171017 /// ```
1018- #[ must_use = "method returns a new number and does not mutate the original value" ]
1018+ // The tests below invoke `clamp` without a return value in order to cause a `panic`.
1019+ // #[must_use = "method returns a new number and does not mutate the original value"]
10191020 #[ unstable( feature = "clamp" , issue = "44095" ) ]
10201021 #[ inline]
10211022 pub fn clamp ( self , min : f32 , max : f32 ) -> f32 {
Original file line number Diff line number Diff line change @@ -936,6 +936,8 @@ impl f64 {
936936 /// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
937937 /// assert!((std::f64::NAN).clamp(-2.0, 1.0).is_nan());
938938 /// ```
939+ // The tests below invoke `clamp` without a return value in order to cause a `panic`.
940+ // #[must_use = "method returns a new number and does not mutate the original value"]
939941 #[ unstable( feature = "clamp" , issue = "44095" ) ]
940942 #[ inline]
941943 pub fn clamp ( self , min : f64 , max : f64 ) -> f64 {
You can’t perform that action at this time.
0 commit comments