@@ -649,6 +649,8 @@ impl f64 {
649
649
///
650
650
/// assert!(abs_difference < 1e-10);
651
651
/// ```
652
+ #[ must_use = "this returns the result of the operation, \
653
+ without modifying the original"]
652
654
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
653
655
#[ inline]
654
656
pub fn to_degrees ( self ) -> f64 {
@@ -667,6 +669,8 @@ impl f64 {
667
669
///
668
670
/// assert!(abs_difference < 1e-10);
669
671
/// ```
672
+ #[ must_use = "this returns the result of the operation, \
673
+ without modifying the original"]
670
674
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
671
675
#[ inline]
672
676
pub fn to_radians ( self ) -> f64 {
@@ -726,6 +730,8 @@ impl f64 {
726
730
/// * Not be `NaN`
727
731
/// * Not be infinite
728
732
/// * 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"]
729
735
#[ stable( feature = "float_approx_unchecked_to" , since = "1.44.0" ) ]
730
736
#[ inline]
731
737
pub unsafe fn to_int_unchecked < Int > ( self ) -> Int
@@ -754,6 +760,8 @@ impl f64 {
754
760
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
755
761
///
756
762
/// ```
763
+ #[ must_use = "this returns the result of the operation, \
764
+ without modifying the original"]
757
765
#[ stable( feature = "float_bits_conv" , since = "1.20.0" ) ]
758
766
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
759
767
#[ inline]
@@ -816,6 +824,8 @@ impl f64 {
816
824
/// let bytes = 12.5f64.to_be_bytes();
817
825
/// assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
818
826
/// ```
827
+ #[ must_use = "this returns the result of the operation, \
828
+ without modifying the original"]
819
829
#[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
820
830
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
821
831
#[ inline]
@@ -832,6 +842,8 @@ impl f64 {
832
842
/// let bytes = 12.5f64.to_le_bytes();
833
843
/// assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
834
844
/// ```
845
+ #[ must_use = "this returns the result of the operation, \
846
+ without modifying the original"]
835
847
#[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
836
848
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
837
849
#[ inline]
@@ -861,6 +873,8 @@ impl f64 {
861
873
/// }
862
874
/// );
863
875
/// ```
876
+ #[ must_use = "this returns the result of the operation, \
877
+ without modifying the original"]
864
878
#[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
865
879
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
866
880
#[ inline]
0 commit comments