@@ -449,7 +449,7 @@ macro_rules! int_impl {
449449 #[ inline]
450450 pub const fn checked_add( self , rhs: Self ) -> Option <Self > {
451451 let ( a, b) = self . overflowing_add( rhs) ;
452- if unlikely! ( b) { None } else { Some ( a) }
452+ if intrinsics :: unlikely( b) { None } else { Some ( a) }
453453 }
454454
455455 /// Strict integer addition. Computes `self + rhs`, panicking
@@ -545,7 +545,7 @@ macro_rules! int_impl {
545545 #[ inline]
546546 pub const fn checked_add_unsigned( self , rhs: $UnsignedT) -> Option <Self > {
547547 let ( a, b) = self . overflowing_add_unsigned( rhs) ;
548- if unlikely! ( b) { None } else { Some ( a) }
548+ if intrinsics :: unlikely( b) { None } else { Some ( a) }
549549 }
550550
551551 /// Strict addition with an unsigned integer. Computes `self + rhs`,
@@ -601,7 +601,7 @@ macro_rules! int_impl {
601601 #[ inline]
602602 pub const fn checked_sub( self , rhs: Self ) -> Option <Self > {
603603 let ( a, b) = self . overflowing_sub( rhs) ;
604- if unlikely! ( b) { None } else { Some ( a) }
604+ if intrinsics :: unlikely( b) { None } else { Some ( a) }
605605 }
606606
607607 /// Strict integer subtraction. Computes `self - rhs`, panicking if
@@ -697,7 +697,7 @@ macro_rules! int_impl {
697697 #[ inline]
698698 pub const fn checked_sub_unsigned( self , rhs: $UnsignedT) -> Option <Self > {
699699 let ( a, b) = self . overflowing_sub_unsigned( rhs) ;
700- if unlikely! ( b) { None } else { Some ( a) }
700+ if intrinsics :: unlikely( b) { None } else { Some ( a) }
701701 }
702702
703703 /// Strict subtraction with an unsigned integer. Computes `self - rhs`,
@@ -753,7 +753,7 @@ macro_rules! int_impl {
753753 #[ inline]
754754 pub const fn checked_mul( self , rhs: Self ) -> Option <Self > {
755755 let ( a, b) = self . overflowing_mul( rhs) ;
756- if unlikely! ( b) { None } else { Some ( a) }
756+ if intrinsics :: unlikely( b) { None } else { Some ( a) }
757757 }
758758
759759 /// Strict integer multiplication. Computes `self * rhs`, panicking if
@@ -849,7 +849,7 @@ macro_rules! int_impl {
849849 without modifying the original"]
850850 #[ inline]
851851 pub const fn checked_div( self , rhs: Self ) -> Option <Self > {
852- if unlikely! ( rhs == 0 || ( ( self == Self :: MIN ) && ( rhs == -1 ) ) ) {
852+ if intrinsics :: unlikely( rhs == 0 || ( ( self == Self :: MIN ) && ( rhs == -1 ) ) ) {
853853 None
854854 } else {
855855 // SAFETY: div by zero and by INT_MIN have been checked above
@@ -924,7 +924,7 @@ macro_rules! int_impl {
924924 #[ inline]
925925 pub const fn checked_div_euclid( self , rhs: Self ) -> Option <Self > {
926926 // Using `&` helps LLVM see that it is the same check made in division.
927- if unlikely! ( rhs == 0 || ( ( self == Self :: MIN ) & ( rhs == -1 ) ) ) {
927+ if intrinsics :: unlikely( rhs == 0 || ( ( self == Self :: MIN ) & ( rhs == -1 ) ) ) {
928928 None
929929 } else {
930930 Some ( self . div_euclid( rhs) )
@@ -997,7 +997,7 @@ macro_rules! int_impl {
997997 without modifying the original"]
998998 #[ inline]
999999 pub const fn checked_rem( self , rhs: Self ) -> Option <Self > {
1000- if unlikely! ( rhs == 0 || ( ( self == Self :: MIN ) && ( rhs == -1 ) ) ) {
1000+ if intrinsics :: unlikely( rhs == 0 || ( ( self == Self :: MIN ) && ( rhs == -1 ) ) ) {
10011001 None
10021002 } else {
10031003 // SAFETY: div by zero and by INT_MIN have been checked above
@@ -1071,7 +1071,7 @@ macro_rules! int_impl {
10711071 #[ inline]
10721072 pub const fn checked_rem_euclid( self , rhs: Self ) -> Option <Self > {
10731073 // Using `&` helps LLVM see that it is the same check made in division.
1074- if unlikely! ( rhs == 0 || ( ( self == Self :: MIN ) & ( rhs == -1 ) ) ) {
1074+ if intrinsics :: unlikely( rhs == 0 || ( ( self == Self :: MIN ) & ( rhs == -1 ) ) ) {
10751075 None
10761076 } else {
10771077 Some ( self . rem_euclid( rhs) )
@@ -1142,7 +1142,7 @@ macro_rules! int_impl {
11421142 #[ inline]
11431143 pub const fn checked_neg( self ) -> Option <Self > {
11441144 let ( a, b) = self . overflowing_neg( ) ;
1145- if unlikely! ( b) { None } else { Some ( a) }
1145+ if intrinsics :: unlikely( b) { None } else { Some ( a) }
11461146 }
11471147
11481148 /// Unchecked negation. Computes `-self`, assuming overflow cannot occur.
@@ -2564,7 +2564,7 @@ macro_rules! int_impl {
25642564 without modifying the original"]
25652565 pub const fn overflowing_div( self , rhs: Self ) -> ( Self , bool ) {
25662566 // Using `&` helps LLVM see that it is the same check made in division.
2567- if unlikely! ( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
2567+ if intrinsics :: unlikely( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
25682568 ( self , true )
25692569 } else {
25702570 ( self / rhs, false )
@@ -2595,7 +2595,7 @@ macro_rules! int_impl {
25952595 without modifying the original"]
25962596 pub const fn overflowing_div_euclid( self , rhs: Self ) -> ( Self , bool ) {
25972597 // Using `&` helps LLVM see that it is the same check made in division.
2598- if unlikely! ( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
2598+ if intrinsics :: unlikely( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
25992599 ( self , true )
26002600 } else {
26012601 ( self . div_euclid( rhs) , false )
@@ -2625,7 +2625,7 @@ macro_rules! int_impl {
26252625 #[ must_use = "this returns the result of the operation, \
26262626 without modifying the original"]
26272627 pub const fn overflowing_rem( self , rhs: Self ) -> ( Self , bool ) {
2628- if unlikely! ( rhs == -1 ) {
2628+ if intrinsics :: unlikely( rhs == -1 ) {
26292629 ( 0 , self == Self :: MIN )
26302630 } else {
26312631 ( self % rhs, false )
@@ -2657,7 +2657,7 @@ macro_rules! int_impl {
26572657 #[ inline]
26582658 #[ track_caller]
26592659 pub const fn overflowing_rem_euclid( self , rhs: Self ) -> ( Self , bool ) {
2660- if unlikely! ( rhs == -1 ) {
2660+ if intrinsics :: unlikely( rhs == -1 ) {
26612661 ( 0 , self == Self :: MIN )
26622662 } else {
26632663 ( self . rem_euclid( rhs) , false )
@@ -2686,7 +2686,7 @@ macro_rules! int_impl {
26862686 without modifying the original"]
26872687 #[ allow( unused_attributes) ]
26882688 pub const fn overflowing_neg( self ) -> ( Self , bool ) {
2689- if unlikely! ( self == Self :: MIN ) {
2689+ if intrinsics :: unlikely( self == Self :: MIN ) {
26902690 ( Self :: MIN , true )
26912691 } else {
26922692 ( -self , false )
0 commit comments