File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1015,7 +1015,8 @@ impl f32 {
1015
1015
/// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
1016
1016
/// assert!((std::f32::NAN).clamp(-2.0, 1.0).is_nan());
1017
1017
/// ```
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"]
1019
1020
#[ unstable( feature = "clamp" , issue = "44095" ) ]
1020
1021
#[ inline]
1021
1022
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 {
936
936
/// assert!((2.0f64).clamp(-2.0, 1.0) == 1.0);
937
937
/// assert!((std::f64::NAN).clamp(-2.0, 1.0).is_nan());
938
938
/// ```
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"]
939
941
#[ unstable( feature = "clamp" , issue = "44095" ) ]
940
942
#[ inline]
941
943
pub fn clamp ( self , min : f64 , max : f64 ) -> f64 {
You can’t perform that action at this time.
0 commit comments