diff options
| author | bors <bors@rust-lang.org> | 2015-03-01 08:59:29 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-01 08:59:29 +0000 |
| commit | 0eb0ba38d0893f711e68321d3e6fe28a929cd00e (patch) | |
| tree | f352105235425f677a950f1c88bd5391da0f9721 /src/libcore | |
| parent | 0905c8a5ec856a6b972fcb239df2b8f6e82d2418 (diff) | |
| parent | 1c4fb909ffad8328983d893f2fefdb17215f2b21 (diff) | |
| download | rust-0eb0ba38d0893f711e68321d3e6fe28a929cd00e.tar.gz rust-0eb0ba38d0893f711e68321d3e6fe28a929cd00e.zip | |
Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichton
Fixes issue #22016
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/num/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index b1039f79f23..318799f59a8 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -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; |
