@@ -282,6 +282,7 @@ macro_rules! int_impl {
282
282
/// ```
283
283
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
284
284
#[ rustc_const_stable( feature = "const_int_conversions" , since = "1.32.0" ) ]
285
+ #[ must_use]
285
286
#[ inline]
286
287
pub const fn from_be( x: Self ) -> Self {
287
288
#[ cfg( target_endian = "big" ) ]
@@ -313,6 +314,7 @@ macro_rules! int_impl {
313
314
/// ```
314
315
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
315
316
#[ rustc_const_stable( feature = "const_int_conversions" , since = "1.32.0" ) ]
317
+ #[ must_use]
316
318
#[ inline]
317
319
pub const fn from_le( x: Self ) -> Self {
318
320
#[ cfg( target_endian = "little" ) ]
@@ -2620,6 +2622,7 @@ macro_rules! int_impl {
2620
2622
/// ```
2621
2623
#[ stable( feature = "int_to_from_bytes" , since = "1.32.0" ) ]
2622
2624
#[ rustc_const_stable( feature = "const_int_conversion" , since = "1.44.0" ) ]
2625
+ #[ must_use]
2623
2626
#[ inline]
2624
2627
pub const fn from_be_bytes( bytes: [ u8 ; mem:: size_of:: <Self >( ) ] ) -> Self {
2625
2628
Self :: from_be( Self :: from_ne_bytes( bytes) )
@@ -2650,6 +2653,7 @@ macro_rules! int_impl {
2650
2653
/// ```
2651
2654
#[ stable( feature = "int_to_from_bytes" , since = "1.32.0" ) ]
2652
2655
#[ rustc_const_stable( feature = "const_int_conversion" , since = "1.44.0" ) ]
2656
+ #[ must_use]
2653
2657
#[ inline]
2654
2658
pub const fn from_le_bytes( bytes: [ u8 ; mem:: size_of:: <Self >( ) ] ) -> Self {
2655
2659
Self :: from_le( Self :: from_ne_bytes( bytes) )
@@ -2691,6 +2695,7 @@ macro_rules! int_impl {
2691
2695
/// ```
2692
2696
#[ stable( feature = "int_to_from_bytes" , since = "1.32.0" ) ]
2693
2697
#[ rustc_const_stable( feature = "const_int_conversion" , since = "1.44.0" ) ]
2698
+ #[ must_use]
2694
2699
// SAFETY: const sound because integers are plain old datatypes so we can always
2695
2700
// transmute to them
2696
2701
#[ inline]
0 commit comments