Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichton
Fixes issue #22016
This commit is contained in:
@@ -372,9 +372,10 @@ pub trait Int
|
||||
#[unstable(feature = "core",
|
||||
reason = "pending integer conventions")]
|
||||
#[inline]
|
||||
fn pow(self, mut exp: uint) -> Self {
|
||||
fn pow(self, mut exp: u32) -> Self {
|
||||
let mut base = self;
|
||||
let mut acc: Self = Int::one();
|
||||
|
||||
while exp > 0 {
|
||||
if (exp & 1) == 1 {
|
||||
acc = acc * base;
|
||||
|
||||
Reference in New Issue
Block a user