@@ -220,8 +220,8 @@ impl f32 {
220220 ///
221221 /// assert!(f32::NAN.copysign(1.0).is_nan());
222222 /// ```
223- #[ inline]
224223 #[ must_use = "method returns a new number and does not mutate the original value" ]
224+ #[ inline]
225225 #[ stable( feature = "copysign" , since = "1.35.0" ) ]
226226 pub fn copysign ( self , sign : f32 ) -> f32 {
227227 unsafe { intrinsics:: copysignf32 ( self , sign) }
@@ -247,6 +247,7 @@ impl f32 {
247247 ///
248248 /// assert!(abs_difference <= f32::EPSILON);
249249 /// ```
250+ #[ must_use = "method returns a new number and does not mutate the original value" ]
250251 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
251252 #[ inline]
252253 pub fn mul_add ( self , a : f32 , b : f32 ) -> f32 {
@@ -270,6 +271,7 @@ impl f32 {
270271 /// assert_eq!(a.div_euclid(-b), -1.0); // 7.0 >= -4.0 * -1.0
271272 /// assert_eq!((-a).div_euclid(-b), 2.0); // -7.0 >= -4.0 * 2.0
272273 /// ```
274+ #[ must_use = "method returns a new number and does not mutate the original value" ]
273275 #[ inline]
274276 #[ stable( feature = "euclidean_division" , since = "1.38.0" ) ]
275277 pub fn div_euclid ( self , rhs : f32 ) -> f32 {
@@ -303,6 +305,7 @@ impl f32 {
303305 /// // limitation due to round-off error
304306 /// assert!((-std::f32::EPSILON).rem_euclid(3.0) != 0.0);
305307 /// ```
308+ #[ must_use = "method returns a new number and does not mutate the original value" ]
306309 #[ inline]
307310 #[ stable( feature = "euclidean_division" , since = "1.38.0" ) ]
308311 pub fn rem_euclid ( self , rhs : f32 ) -> f32 {
@@ -329,6 +332,7 @@ impl f32 {
329332 ///
330333 /// assert!(abs_difference <= f32::EPSILON);
331334 /// ```
335+ #[ must_use = "method returns a new number and does not mutate the original value" ]
332336 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
333337 #[ inline]
334338 pub fn powi ( self , n : i32 ) -> f32 {
@@ -347,6 +351,7 @@ impl f32 {
347351 ///
348352 /// assert!(abs_difference <= f32::EPSILON);
349353 /// ```
354+ #[ must_use = "method returns a new number and does not mutate the original value" ]
350355 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
351356 #[ inline]
352357 pub fn powf ( self , n : f32 ) -> f32 {
@@ -478,6 +483,7 @@ impl f32 {
478483 ///
479484 /// assert!(abs_difference <= f32::EPSILON);
480485 /// ```
486+ #[ must_use = "method returns a new number and does not mutate the original value" ]
481487 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
482488 #[ inline]
483489 pub fn log ( self , base : f32 ) -> f32 { self . ln ( ) / base. ln ( ) }
@@ -550,6 +556,7 @@ impl f32 {
550556 /// assert!(abs_difference_x <= f32::EPSILON);
551557 /// assert!(abs_difference_y <= f32::EPSILON);
552558 /// ```
559+ #[ must_use = "method returns a new number and does not mutate the original value" ]
553560 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
554561 #[ inline]
555562 #[ rustc_deprecated( since = "1.10.0" ,
@@ -601,6 +608,7 @@ impl f32 {
601608 ///
602609 /// assert!(abs_difference <= f32::EPSILON);
603610 /// ```
611+ #[ must_use = "method returns a new number and does not mutate the original value" ]
604612 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
605613 #[ inline]
606614 pub fn hypot ( self , other : f32 ) -> f32 {
@@ -770,6 +778,7 @@ impl f32 {
770778 /// assert!(abs_difference_1 <= f32::EPSILON);
771779 /// assert!(abs_difference_2 <= f32::EPSILON);
772780 /// ```
781+ #[ must_use = "method returns a new number and does not mutate the original value" ]
773782 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
774783 #[ inline]
775784 pub fn atan2 ( self , other : f32 ) -> f32 {
@@ -1006,6 +1015,7 @@ impl f32 {
10061015 /// assert!((2.0f32).clamp(-2.0, 1.0) == 1.0);
10071016 /// assert!((std::f32::NAN).clamp(-2.0, 1.0).is_nan());
10081017 /// ```
1018+ #[ must_use = "method returns a new number and does not mutate the original value" ]
10091019 #[ unstable( feature = "clamp" , issue = "44095" ) ]
10101020 #[ inline]
10111021 pub fn clamp ( self , min : f32 , max : f32 ) -> f32 {
0 commit comments