Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichton

Fixes issue #22016
This commit is contained in:
bors
2015-03-01 08:59:29 +00:00
4 changed files with 15 additions and 3 deletions

View File

@@ -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;