@@ -1720,6 +1720,7 @@ macro_rules! int_impl {
17201720 ///
17211721 /// ```
17221722 #[ doc = concat!( "assert_eq!(8" , stringify!( $SelfT) , ".checked_pow(2), Some(64));" ) ]
1723+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".checked_pow(0), Some(1));" ) ]
17231724 #[ doc = concat!( "assert_eq!(" , stringify!( $SelfT) , "::MAX.checked_pow(2), None);" ) ]
17241725 /// ```
17251726
@@ -1761,6 +1762,7 @@ macro_rules! int_impl {
17611762 ///
17621763 /// ```
17631764 #[ doc = concat!( "assert_eq!(8" , stringify!( $SelfT) , ".strict_pow(2), 64);" ) ]
1765+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".strict_pow(0), 1);" ) ]
17641766 /// ```
17651767 ///
17661768 /// The following panics because of overflow:
@@ -2033,6 +2035,7 @@ macro_rules! int_impl {
20332035 ///
20342036 /// ```
20352037 #[ doc = concat!( "assert_eq!((-4" , stringify!( $SelfT) , ").saturating_pow(3), -64);" ) ]
2038+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".saturating_pow(0), 1);" ) ]
20362039 #[ doc = concat!( "assert_eq!(" , stringify!( $SelfT) , "::MIN.saturating_pow(2), " , stringify!( $SelfT) , "::MAX);" ) ]
20372040 #[ doc = concat!( "assert_eq!(" , stringify!( $SelfT) , "::MIN.saturating_pow(3), " , stringify!( $SelfT) , "::MIN);" ) ]
20382041 /// ```
@@ -2377,6 +2380,7 @@ macro_rules! int_impl {
23772380 #[ doc = concat!( "assert_eq!(3" , stringify!( $SelfT) , ".wrapping_pow(4), 81);" ) ]
23782381 /// assert_eq!(3i8.wrapping_pow(5), -13);
23792382 /// assert_eq!(3i8.wrapping_pow(6), -39);
2383+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".wrapping_pow(0), 1);" ) ]
23802384 /// ```
23812385 #[ stable( feature = "no_panic_pow" , since = "1.34.0" ) ]
23822386 #[ rustc_const_stable( feature = "const_int_pow" , since = "1.50.0" ) ]
@@ -2967,6 +2971,7 @@ macro_rules! int_impl {
29672971 ///
29682972 /// ```
29692973 #[ doc = concat!( "assert_eq!(3" , stringify!( $SelfT) , ".overflowing_pow(4), (81, false));" ) ]
2974+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".overflowing_pow(0), (1, false));" ) ]
29702975 /// assert_eq!(3i8.overflowing_pow(5), (-13, true));
29712976 /// ```
29722977 #[ stable( feature = "no_panic_pow" , since = "1.34.0" ) ]
@@ -3010,6 +3015,7 @@ macro_rules! int_impl {
30103015 #[ doc = concat!( "let x: " , stringify!( $SelfT) , " = 2; // or any other integer type" ) ]
30113016 ///
30123017 /// assert_eq!(x.pow(5), 32);
3018+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".pow(0), 1);" ) ]
30133019 /// ```
30143020 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
30153021 #[ rustc_const_stable( feature = "const_int_pow" , since = "1.50.0" ) ]
0 commit comments