@@ -387,7 +387,7 @@ assert_eq!(n.count_ones(), 3);
387
387
```" ) ,
388
388
#[ inline]
389
389
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
390
- pub fn count_ones( self ) -> u32 {
390
+ pub const fn count_ones( self ) -> u32 {
391
391
self . 0 . count_ones( )
392
392
}
393
393
}
@@ -407,7 +407,7 @@ assert_eq!(Wrapping(!0", stringify!($t), ").count_zeros(), 0);
407
407
```" ) ,
408
408
#[ inline]
409
409
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
410
- pub fn count_zeros( self ) -> u32 {
410
+ pub const fn count_zeros( self ) -> u32 {
411
411
self . 0 . count_zeros( )
412
412
}
413
413
}
@@ -430,7 +430,7 @@ assert_eq!(n.trailing_zeros(), 3);
430
430
```" ) ,
431
431
#[ inline]
432
432
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
433
- pub fn trailing_zeros( self ) -> u32 {
433
+ pub const fn trailing_zeros( self ) -> u32 {
434
434
self . 0 . trailing_zeros( )
435
435
}
436
436
}
@@ -456,7 +456,7 @@ assert_eq!(n.trailing_zeros(), 3);
456
456
/// ```
457
457
#[ inline]
458
458
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
459
- pub fn rotate_left( self , n: u32 ) -> Self {
459
+ pub const fn rotate_left( self , n: u32 ) -> Self {
460
460
Wrapping ( self . 0 . rotate_left( n) )
461
461
}
462
462
@@ -481,7 +481,7 @@ assert_eq!(n.trailing_zeros(), 3);
481
481
/// ```
482
482
#[ inline]
483
483
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
484
- pub fn rotate_right( self , n: u32 ) -> Self {
484
+ pub const fn rotate_right( self , n: u32 ) -> Self {
485
485
Wrapping ( self . 0 . rotate_right( n) )
486
486
}
487
487
@@ -505,7 +505,7 @@ assert_eq!(n.trailing_zeros(), 3);
505
505
/// ```
506
506
#[ inline]
507
507
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
508
- pub fn swap_bytes( self ) -> Self {
508
+ pub const fn swap_bytes( self ) -> Self {
509
509
Wrapping ( self . 0 . swap_bytes( ) )
510
510
}
511
511
@@ -532,7 +532,7 @@ assert_eq!(n.trailing_zeros(), 3);
532
532
/// ```
533
533
#[ unstable( feature = "reverse_bits" , issue = "48763" ) ]
534
534
#[ inline]
535
- pub fn reverse_bits( self ) -> Self {
535
+ pub const fn reverse_bits( self ) -> Self {
536
536
Wrapping ( self . 0 . reverse_bits( ) )
537
537
}
538
538
@@ -560,7 +560,7 @@ if cfg!(target_endian = \"big\") {
560
560
```" ) ,
561
561
#[ inline]
562
562
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
563
- pub fn from_be( x: Self ) -> Self {
563
+ pub const fn from_be( x: Self ) -> Self {
564
564
Wrapping ( <$t>:: from_be( x. 0 ) )
565
565
}
566
566
}
@@ -589,7 +589,7 @@ if cfg!(target_endian = \"little\") {
589
589
```" ) ,
590
590
#[ inline]
591
591
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
592
- pub fn from_le( x: Self ) -> Self {
592
+ pub const fn from_le( x: Self ) -> Self {
593
593
Wrapping ( <$t>:: from_le( x. 0 ) )
594
594
}
595
595
}
@@ -618,7 +618,7 @@ if cfg!(target_endian = \"big\") {
618
618
```" ) ,
619
619
#[ inline]
620
620
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
621
- pub fn to_be( self ) -> Self {
621
+ pub const fn to_be( self ) -> Self {
622
622
Wrapping ( self . 0 . to_be( ) )
623
623
}
624
624
}
@@ -647,7 +647,7 @@ if cfg!(target_endian = \"little\") {
647
647
```" ) ,
648
648
#[ inline]
649
649
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
650
- pub fn to_le( self ) -> Self {
650
+ pub const fn to_le( self ) -> Self {
651
651
Wrapping ( self . 0 . to_le( ) )
652
652
}
653
653
}
@@ -707,7 +707,7 @@ assert_eq!(n.leading_zeros(), 3);
707
707
```" ) ,
708
708
#[ inline]
709
709
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
710
- pub fn leading_zeros( self ) -> u32 {
710
+ pub const fn leading_zeros( self ) -> u32 {
711
711
self . 0 . leading_zeros( )
712
712
}
713
713
}
@@ -784,7 +784,7 @@ assert!(!Wrapping(-10", stringify!($t), ").is_positive());
784
784
```" ) ,
785
785
#[ inline]
786
786
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
787
- pub fn is_positive( self ) -> bool {
787
+ pub const fn is_positive( self ) -> bool {
788
788
self . 0 . is_positive( )
789
789
}
790
790
}
@@ -806,7 +806,7 @@ assert!(!Wrapping(10", stringify!($t), ").is_negative());
806
806
```" ) ,
807
807
#[ inline]
808
808
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
809
- pub fn is_negative( self ) -> bool {
809
+ pub const fn is_negative( self ) -> bool {
810
810
self . 0 . is_negative( )
811
811
}
812
812
}
@@ -836,7 +836,7 @@ assert_eq!(n.leading_zeros(), 2);
836
836
```" ) ,
837
837
#[ inline]
838
838
#[ unstable( feature = "wrapping_int_impl" , issue = "32463" ) ]
839
- pub fn leading_zeros( self ) -> u32 {
839
+ pub const fn leading_zeros( self ) -> u32 {
840
840
self . 0 . leading_zeros( )
841
841
}
842
842
}
0 commit comments