@@ -658,6 +658,8 @@ impl f64 {
658658 ///
659659 /// assert!(abs_difference < 1e-10);
660660 /// ```
661+ #[ must_use = "this returns the result of the operation, \
662+ without modifying the original"]
661663 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
662664 #[ inline]
663665 pub fn to_degrees ( self ) -> f64 {
@@ -676,6 +678,8 @@ impl f64 {
676678 ///
677679 /// assert!(abs_difference < 1e-10);
678680 /// ```
681+ #[ must_use = "this returns the result of the operation, \
682+ without modifying the original"]
679683 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
680684 #[ inline]
681685 pub fn to_radians ( self ) -> f64 {
@@ -735,6 +739,8 @@ impl f64 {
735739 /// * Not be `NaN`
736740 /// * Not be infinite
737741 /// * Be representable in the return type `Int`, after truncating off its fractional part
742+ #[ must_use = "this returns the result of the operation, \
743+ without modifying the original"]
738744 #[ stable( feature = "float_approx_unchecked_to" , since = "1.44.0" ) ]
739745 #[ inline]
740746 pub unsafe fn to_int_unchecked < Int > ( self ) -> Int
@@ -763,6 +769,8 @@ impl f64 {
763769 /// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
764770 ///
765771 /// ```
772+ #[ must_use = "this returns the result of the operation, \
773+ without modifying the original"]
766774 #[ stable( feature = "float_bits_conv" , since = "1.20.0" ) ]
767775 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
768776 #[ inline]
@@ -825,6 +833,8 @@ impl f64 {
825833 /// let bytes = 12.5f64.to_be_bytes();
826834 /// assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
827835 /// ```
836+ #[ must_use = "this returns the result of the operation, \
837+ without modifying the original"]
828838 #[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
829839 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
830840 #[ inline]
@@ -841,6 +851,8 @@ impl f64 {
841851 /// let bytes = 12.5f64.to_le_bytes();
842852 /// assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
843853 /// ```
854+ #[ must_use = "this returns the result of the operation, \
855+ without modifying the original"]
844856 #[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
845857 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
846858 #[ inline]
@@ -870,6 +882,8 @@ impl f64 {
870882 /// }
871883 /// );
872884 /// ```
885+ #[ must_use = "this returns the result of the operation, \
886+ without modifying the original"]
873887 #[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
874888 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
875889 #[ inline]
0 commit comments