diff options
| author | bors <bors@rust-lang.org> | 2014-04-02 16:36:50 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-02 16:36:50 -0700 |
| commit | f503f6c0b90e69425952ddc3ee3c6022be769ace (patch) | |
| tree | 07ce928ee77fea3d2b0a1d0bbfe021038bd0d708 /src/libstd/num | |
| parent | 3786b552a6ffd2219d8e42df6f8db6cc386cce56 (diff) | |
| parent | 9a259f4303cd6550a38ccd12b07ae14c1e21a263 (diff) | |
| download | rust-f503f6c0b90e69425952ddc3ee3c6022be769ace.tar.gz rust-f503f6c0b90e69425952ddc3ee3c6022be769ace.zip | |
auto merge of #13257 : alexcrichton/rust/index-uint, r=pnkfelix
The details are outlined in the first commit. Closes #10453
Diffstat (limited to 'src/libstd/num')
| -rw-r--r-- | src/libstd/num/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/num/strconv.rs | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 2c628112957..761bd072bf8 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -1655,7 +1655,7 @@ mod tests { macro_rules! test_next_power_of_two( ($test_name:ident, $T:ident) => ( fn $test_name() { - #[test]; + #![test] assert_eq!(next_power_of_two::<$T>(0), 0); let mut next_power = 1; for i in range::<$T>(1, 40) { @@ -1675,7 +1675,7 @@ mod tests { macro_rules! test_checked_next_power_of_two( ($test_name:ident, $T:ident) => ( fn $test_name() { - #[test]; + #![test] assert_eq!(checked_next_power_of_two::<$T>(0), None); let mut next_power = 1; for i in range::<$T>(1, 40) { diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index 15c7b251fa7..b15b5872fc2 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -411,23 +411,23 @@ pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+Round+ // If reached left end of number, have to // insert additional digit: if i < 0 - || buf[i] == '-' as u8 - || buf[i] == '+' as u8 { + || buf[i as uint] == '-' as u8 + || buf[i as uint] == '+' as u8 { buf.insert((i + 1) as uint, value2ascii(1)); break; } // Skip the '.' - if buf[i] == '.' as u8 { i -= 1; continue; } + if buf[i as uint] == '.' as u8 { i -= 1; continue; } // Either increment the digit, // or set to 0 if max and carry the 1. - let current_digit = ascii2value(buf[i]); + let current_digit = ascii2value(buf[i as uint]); if current_digit < (radix - 1) { - buf[i] = value2ascii(current_digit+1); + buf[i as uint] = value2ascii(current_digit+1); break; } else { - buf[i] = value2ascii(0); + buf[i as uint] = value2ascii(0); i -= 1; } } |
