@@ -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 b { None } else { Some ( a) }
453453 }
454454
455455 /// Strict integer addition. Computes `self + rhs`, panicking
@@ -484,7 +484,7 @@ macro_rules! int_impl {
484484 #[ track_caller]
485485 pub const fn strict_add( self , rhs: Self ) -> Self {
486486 let ( a, b) = self . overflowing_add( rhs) ;
487- if unlikely! ( b ) { overflow_panic:: add( ) } else { a }
487+ if b { overflow_panic:: add( ) } else { a }
488488 }
489489
490490 /// Unchecked integer addition. Computes `self + rhs`, assuming overflow
@@ -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 b { None } else { Some ( a) }
549549 }
550550
551551 /// Strict addition with an unsigned integer. Computes `self + rhs`,
@@ -580,7 +580,7 @@ macro_rules! int_impl {
580580 #[ track_caller]
581581 pub const fn strict_add_unsigned( self , rhs: $UnsignedT) -> Self {
582582 let ( a, b) = self . overflowing_add_unsigned( rhs) ;
583- if unlikely! ( b ) { overflow_panic:: add( ) } else { a }
583+ if b { overflow_panic:: add( ) } else { a }
584584 }
585585
586586 /// Checked integer subtraction. Computes `self - rhs`, returning `None` if
@@ -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 b { None } else { Some ( a) }
605605 }
606606
607607 /// Strict integer subtraction. Computes `self - rhs`, panicking if
@@ -636,7 +636,7 @@ macro_rules! int_impl {
636636 #[ track_caller]
637637 pub const fn strict_sub( self , rhs: Self ) -> Self {
638638 let ( a, b) = self . overflowing_sub( rhs) ;
639- if unlikely! ( b ) { overflow_panic:: sub( ) } else { a }
639+ if b { overflow_panic:: sub( ) } else { a }
640640 }
641641
642642 /// Unchecked integer subtraction. Computes `self - rhs`, assuming overflow
@@ -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 b { None } else { Some ( a) }
701701 }
702702
703703 /// Strict subtraction with an unsigned integer. Computes `self - rhs`,
@@ -732,7 +732,7 @@ macro_rules! int_impl {
732732 #[ track_caller]
733733 pub const fn strict_sub_unsigned( self , rhs: $UnsignedT) -> Self {
734734 let ( a, b) = self . overflowing_sub_unsigned( rhs) ;
735- if unlikely! ( b ) { overflow_panic:: sub( ) } else { a }
735+ if b { overflow_panic:: sub( ) } else { a }
736736 }
737737
738738 /// Checked integer multiplication. Computes `self * rhs`, returning `None` if
@@ -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 b { None } else { Some ( a) }
757757 }
758758
759759 /// Strict integer multiplication. Computes `self * rhs`, panicking if
@@ -788,7 +788,7 @@ macro_rules! int_impl {
788788 #[ track_caller]
789789 pub const fn strict_mul( self , rhs: Self ) -> Self {
790790 let ( a, b) = self . overflowing_mul( rhs) ;
791- if unlikely! ( b ) { overflow_panic:: mul( ) } else { a }
791+ if b { overflow_panic:: mul( ) } else { a }
792792 }
793793
794794 /// Unchecked integer multiplication. Computes `self * rhs`, assuming overflow
@@ -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 rhs == 0 || ( ( self == Self :: MIN ) && ( rhs == -1 ) ) {
853853 None
854854 } else {
855855 // SAFETY: div by zero and by INT_MIN have been checked above
@@ -902,7 +902,7 @@ macro_rules! int_impl {
902902 #[ track_caller]
903903 pub const fn strict_div( self , rhs: Self ) -> Self {
904904 let ( a, b) = self . overflowing_div( rhs) ;
905- if unlikely! ( b ) { overflow_panic:: div( ) } else { a }
905+ if b { overflow_panic:: div( ) } else { a }
906906 }
907907
908908 /// Checked Euclidean division. Computes `self.div_euclid(rhs)`,
@@ -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 rhs == 0 || ( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
928928 None
929929 } else {
930930 Some ( self . div_euclid( rhs) )
@@ -976,7 +976,7 @@ macro_rules! int_impl {
976976 #[ track_caller]
977977 pub const fn strict_div_euclid( self , rhs: Self ) -> Self {
978978 let ( a, b) = self . overflowing_div_euclid( rhs) ;
979- if unlikely! ( b ) { overflow_panic:: div( ) } else { a }
979+ if b { overflow_panic:: div( ) } else { a }
980980 }
981981
982982 /// Checked integer remainder. Computes `self % rhs`, returning `None` if
@@ -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 rhs == 0 || ( ( self == Self :: MIN ) && ( rhs == -1 ) ) {
10011001 None
10021002 } else {
10031003 // SAFETY: div by zero and by INT_MIN have been checked above
@@ -1049,7 +1049,7 @@ macro_rules! int_impl {
10491049 #[ track_caller]
10501050 pub const fn strict_rem( self , rhs: Self ) -> Self {
10511051 let ( a, b) = self . overflowing_rem( rhs) ;
1052- if unlikely! ( b ) { overflow_panic:: rem( ) } else { a }
1052+ if b { overflow_panic:: rem( ) } else { a }
10531053 }
10541054
10551055 /// Checked Euclidean remainder. Computes `self.rem_euclid(rhs)`, returning `None`
@@ -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 rhs == 0 || ( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
10751075 None
10761076 } else {
10771077 Some ( self . rem_euclid( rhs) )
@@ -1122,7 +1122,7 @@ macro_rules! int_impl {
11221122 #[ track_caller]
11231123 pub const fn strict_rem_euclid( self , rhs: Self ) -> Self {
11241124 let ( a, b) = self . overflowing_rem_euclid( rhs) ;
1125- if unlikely! ( b ) { overflow_panic:: rem( ) } else { a }
1125+ if b { overflow_panic:: rem( ) } else { a }
11261126 }
11271127
11281128 /// Checked negation. Computes `-self`, returning `None` if `self == MIN`.
@@ -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 b { None } else { Some ( a) }
11461146 }
11471147
11481148 /// Unchecked negation. Computes `-self`, assuming overflow cannot occur.
@@ -1210,7 +1210,7 @@ macro_rules! int_impl {
12101210 #[ track_caller]
12111211 pub const fn strict_neg( self ) -> Self {
12121212 let ( a, b) = self . overflowing_neg( ) ;
1213- if unlikely! ( b ) { overflow_panic:: neg( ) } else { a }
1213+ if b { overflow_panic:: neg( ) } else { a }
12141214 }
12151215
12161216 /// Checked shift left. Computes `self << rhs`, returning `None` if `rhs` is larger
@@ -1273,7 +1273,7 @@ macro_rules! int_impl {
12731273 #[ track_caller]
12741274 pub const fn strict_shl( self , rhs: u32 ) -> Self {
12751275 let ( a, b) = self . overflowing_shl( rhs) ;
1276- if unlikely! ( b ) { overflow_panic:: shl( ) } else { a }
1276+ if b { overflow_panic:: shl( ) } else { a }
12771277 }
12781278
12791279 /// Unchecked shift left. Computes `self << rhs`, assuming that
@@ -1371,7 +1371,7 @@ macro_rules! int_impl {
13711371 #[ track_caller]
13721372 pub const fn strict_shr( self , rhs: u32 ) -> Self {
13731373 let ( a, b) = self . overflowing_shr( rhs) ;
1374- if unlikely! ( b ) { overflow_panic:: shr( ) } else { a }
1374+ if b { overflow_panic:: shr( ) } else { a }
13751375 }
13761376
13771377 /// Unchecked shift right. Computes `self >> rhs`, assuming that
@@ -2458,7 +2458,7 @@ macro_rules! int_impl {
24582458 without modifying the original"]
24592459 pub const fn overflowing_div( self , rhs: Self ) -> ( Self , bool ) {
24602460 // Using `&` helps LLVM see that it is the same check made in division.
2461- if unlikely! ( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
2461+ if ( self == Self :: MIN ) & ( rhs == -1 ) {
24622462 ( self , true )
24632463 } else {
24642464 ( self / rhs, false )
@@ -2489,7 +2489,7 @@ macro_rules! int_impl {
24892489 without modifying the original"]
24902490 pub const fn overflowing_div_euclid( self , rhs: Self ) -> ( Self , bool ) {
24912491 // Using `&` helps LLVM see that it is the same check made in division.
2492- if unlikely! ( ( self == Self :: MIN ) & ( rhs == -1 ) ) {
2492+ if ( self == Self :: MIN ) & ( rhs == -1 ) {
24932493 ( self , true )
24942494 } else {
24952495 ( self . div_euclid( rhs) , false )
@@ -2519,7 +2519,7 @@ macro_rules! int_impl {
25192519 #[ must_use = "this returns the result of the operation, \
25202520 without modifying the original"]
25212521 pub const fn overflowing_rem( self , rhs: Self ) -> ( Self , bool ) {
2522- if unlikely! ( rhs == -1 ) {
2522+ if rhs == -1 {
25232523 ( 0 , self == Self :: MIN )
25242524 } else {
25252525 ( self % rhs, false )
@@ -2551,7 +2551,7 @@ macro_rules! int_impl {
25512551 #[ inline]
25522552 #[ track_caller]
25532553 pub const fn overflowing_rem_euclid( self , rhs: Self ) -> ( Self , bool ) {
2554- if unlikely! ( rhs == -1 ) {
2554+ if rhs == -1 {
25552555 ( 0 , self == Self :: MIN )
25562556 } else {
25572557 ( self . rem_euclid( rhs) , false )
@@ -2580,7 +2580,7 @@ macro_rules! int_impl {
25802580 without modifying the original"]
25812581 #[ allow( unused_attributes) ]
25822582 pub const fn overflowing_neg( self ) -> ( Self , bool ) {
2583- if unlikely! ( self == Self :: MIN ) {
2583+ if self == Self :: MIN {
25842584 ( Self :: MIN , true )
25852585 } else {
25862586 ( -self , false )
0 commit comments