@@ -658,6 +658,8 @@ impl f64 {
658
658
///
659
659
/// assert!(abs_difference < 1e-10);
660
660
/// ```
661
+ #[ must_use = "this returns the result of the operation, \
662
+ without modifying the original"]
661
663
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
662
664
#[ inline]
663
665
pub fn to_degrees ( self ) -> f64 {
@@ -676,6 +678,8 @@ impl f64 {
676
678
///
677
679
/// assert!(abs_difference < 1e-10);
678
680
/// ```
681
+ #[ must_use = "this returns the result of the operation, \
682
+ without modifying the original"]
679
683
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
680
684
#[ inline]
681
685
pub fn to_radians ( self ) -> f64 {
@@ -735,6 +739,8 @@ impl f64 {
735
739
/// * Not be `NaN`
736
740
/// * Not be infinite
737
741
/// * 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"]
738
744
#[ stable( feature = "float_approx_unchecked_to" , since = "1.44.0" ) ]
739
745
#[ inline]
740
746
pub unsafe fn to_int_unchecked < Int > ( self ) -> Int
@@ -763,6 +769,8 @@ impl f64 {
763
769
/// assert_eq!((12.5f64).to_bits(), 0x4029000000000000);
764
770
///
765
771
/// ```
772
+ #[ must_use = "this returns the result of the operation, \
773
+ without modifying the original"]
766
774
#[ stable( feature = "float_bits_conv" , since = "1.20.0" ) ]
767
775
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
768
776
#[ inline]
@@ -825,6 +833,8 @@ impl f64 {
825
833
/// let bytes = 12.5f64.to_be_bytes();
826
834
/// assert_eq!(bytes, [0x40, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]);
827
835
/// ```
836
+ #[ must_use = "this returns the result of the operation, \
837
+ without modifying the original"]
828
838
#[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
829
839
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
830
840
#[ inline]
@@ -841,6 +851,8 @@ impl f64 {
841
851
/// let bytes = 12.5f64.to_le_bytes();
842
852
/// assert_eq!(bytes, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x40]);
843
853
/// ```
854
+ #[ must_use = "this returns the result of the operation, \
855
+ without modifying the original"]
844
856
#[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
845
857
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
846
858
#[ inline]
@@ -870,6 +882,8 @@ impl f64 {
870
882
/// }
871
883
/// );
872
884
/// ```
885
+ #[ must_use = "this returns the result of the operation, \
886
+ without modifying the original"]
873
887
#[ stable( feature = "float_to_from_bytes" , since = "1.40.0" ) ]
874
888
#[ rustc_const_unstable( feature = "const_float_bits_conv" , issue = "72447" ) ]
875
889
#[ inline]
0 commit comments