@@ -649,6 +649,8 @@ impl f64 {
649649 ///
650650 /// assert!(abs_difference < 1e-10);
651651 /// ```
652+ #[ must_use = "this returns the result of the operation, \
653+ without modifying the original"]
652654 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
653655 #[ inline]
654656 pub fn to_degrees ( self ) -> f64 {
@@ -667,6 +669,8 @@ impl f64 {
667669 ///
668670 /// assert!(abs_difference < 1e-10);
669671 /// ```
672+ #[ must_use = "this returns the result of the operation, \
673+ without modifying the original"]
670674 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
671675 #[ inline]
672676 pub fn to_radians ( self ) -> f64 {
@@ -726,6 +730,8 @@ impl f64 {
726730 /// * Not be `NaN`
727731 /// * Not be infinite
728732 /// * Be representable in the return type `Int`, after truncating off its fractional part
733+ #[ must_use = "this returns the result of the operation, \
734+ without modifying the original"]
729735 #[ stable( feature = "float_approx_unchecked_to" , since = "1.44.0" ) ]
730736 #[ inline]
731737 pub unsafe fn to_int_unchecked < Int > ( self ) -> Int
@@ -754,6 +760,8 @@ impl f64 {
754760 /// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
755761 ///
756762 /// ```
763+ #[ must_use = "this returns the result of the operation, \
764+ without modifying the original"]
757765 #[ stable( feature = "float_bits_conv" , since = "1.20.0" ) ]
758766 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
759767 #[ inline]
@@ -816,6 +824,8 @@ impl f64 {
816824 /// let bytes = 12.5f64.to_be_bytes();
817825 /// assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
818826 /// ```
827+ #[ must_use = "this returns the result of the operation, \
828+ without modifying the original"]
819829 #[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
820830 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
821831 #[ inline]
@@ -832,6 +842,8 @@ impl f64 {
832842 /// let bytes = 12.5f64.to_le_bytes();
833843 /// assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
834844 /// ```
845+ #[ must_use = "this returns the result of the operation, \
846+ without modifying the original"]
835847 #[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
836848 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
837849 #[ inline]
@@ -861,6 +873,8 @@ impl f64 {
861873 /// }
862874 /// );
863875 /// ```
876+ #[ must_use = "this returns the result of the operation, \
877+ without modifying the original"]
864878 #[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
865879 #[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
866880 #[ inline]
0 commit comments