@@ -1714,6 +1714,7 @@ macro_rules! int_impl {
17141714 ///
17151715 /// ```
17161716 #[ doc = concat!( "assert_eq!(8" , stringify!( $SelfT) , ".checked_pow(2), Some(64));" ) ]
1717+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".checked_pow(0), Some(1));" ) ]
17171718 #[ doc = concat!( "assert_eq!(" , stringify!( $SelfT) , "::MAX.checked_pow(2), None);" ) ]
17181719 /// ```
17191720
@@ -1755,6 +1756,7 @@ macro_rules! int_impl {
17551756 ///
17561757 /// ```
17571758 #[ doc = concat!( "assert_eq!(8" , stringify!( $SelfT) , ".strict_pow(2), 64);" ) ]
1759+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".strict_pow(0), 1);" ) ]
17581760 /// ```
17591761 ///
17601762 /// The following panics because of overflow:
@@ -2027,6 +2029,7 @@ macro_rules! int_impl {
20272029 ///
20282030 /// ```
20292031 #[ doc = concat!( "assert_eq!((-4" , stringify!( $SelfT) , ").saturating_pow(3), -64);" ) ]
2032+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".saturating_pow(0), 1);" ) ]
20302033 #[ doc = concat!( "assert_eq!(" , stringify!( $SelfT) , "::MIN.saturating_pow(2), " , stringify!( $SelfT) , "::MAX);" ) ]
20312034 #[ doc = concat!( "assert_eq!(" , stringify!( $SelfT) , "::MIN.saturating_pow(3), " , stringify!( $SelfT) , "::MIN);" ) ]
20322035 /// ```
@@ -2371,6 +2374,7 @@ macro_rules! int_impl {
23712374 #[ doc = concat!( "assert_eq!(3" , stringify!( $SelfT) , ".wrapping_pow(4), 81);" ) ]
23722375 /// assert_eq!(3i8.wrapping_pow(5), -13);
23732376 /// assert_eq!(3i8.wrapping_pow(6), -39);
2377+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".wrapping_pow(0), 1);" ) ]
23742378 /// ```
23752379 #[ stable( feature = "no_panic_pow" , since = "1.34.0" ) ]
23762380 #[ rustc_const_stable( feature = "const_int_pow" , since = "1.50.0" ) ]
@@ -2961,6 +2965,7 @@ macro_rules! int_impl {
29612965 ///
29622966 /// ```
29632967 #[ doc = concat!( "assert_eq!(3" , stringify!( $SelfT) , ".overflowing_pow(4), (81, false));" ) ]
2968+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".overflowing_pow(0), (1, false));" ) ]
29642969 /// assert_eq!(3i8.overflowing_pow(5), (-13, true));
29652970 /// ```
29662971 #[ stable( feature = "no_panic_pow" , since = "1.34.0" ) ]
@@ -3004,6 +3009,7 @@ macro_rules! int_impl {
30043009 #[ doc = concat!( "let x: " , stringify!( $SelfT) , " = 2; // or any other integer type" ) ]
30053010 ///
30063011 /// assert_eq!(x.pow(5), 32);
3012+ #[ doc = concat!( "assert_eq!(0_" , stringify!( $SelfT) , ".pow(0), 1);" ) ]
30073013 /// ```
30083014 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
30093015 #[ rustc_const_stable( feature = "const_int_pow" , since = "1.50.0" ) ]
0 commit comments