Fix fallout of requiring uint indices

This commit is contained in:
Alex Crichton 2014-04-01 20:39:26 -07:00
parent 46abacfdfe
commit 9a259f4303
29 changed files with 118 additions and 118 deletions

View file

@ -1600,12 +1600,12 @@ fn test_insert() {
#[deriving(Hash, Eq, TotalEq)]
struct Dropable {
k: int
k: uint
}
impl Dropable {
fn new(k: int) -> Dropable {
fn new(k: uint) -> Dropable {
local_data::get_mut(drop_vector,
|v| { v.unwrap().as_mut_slice()[k] += 1; });
@ -1628,24 +1628,24 @@ fn test_drops() {
let mut m = HashMap::new();
local_data::get(drop_vector, |v| {
for i in range(0, 200) {
for i in range(0u, 200) {
assert_eq!(v.unwrap().as_slice()[i], 0);
}
});
for i in range(0, 100) {
for i in range(0u, 100) {
let d1 = Dropable::new(i);
let d2 = Dropable::new(i+100);
m.insert(d1, d2);
}
local_data::get(drop_vector, |v| {
for i in range(0, 200) {
for i in range(0u, 200) {
assert_eq!(v.unwrap().as_slice()[i], 1);
}
});
for i in range(0, 50) {
for i in range(0u, 50) {
let k = Dropable::new(i);
let v = m.pop(&k);
@ -1658,12 +1658,12 @@ fn test_drops() {
}
local_data::get(drop_vector, |v| {
for i in range(0, 50) {
for i in range(0u, 50) {
assert_eq!(v.unwrap().as_slice()[i], 0);
assert_eq!(v.unwrap().as_slice()[i+100], 0);
}
for i in range(50, 100) {
for i in range(50u, 100) {
assert_eq!(v.unwrap().as_slice()[i], 1);
assert_eq!(v.unwrap().as_slice()[i+100], 1);
}
@ -1671,7 +1671,7 @@ fn test_drops() {
}
local_data::get(drop_vector, |v| {
for i in range(0, 200) {
for i in range(0u, 200) {
assert_eq!(v.unwrap().as_slice()[i], 0);
}
});

View file

@ -296,7 +296,7 @@ pub struct fd_set {
}
pub fn fd_set(set: &mut fd_set, fd: i32) {
set.fds_bits[fd / 32] |= 1 << (fd % 32);
set.fds_bits[(fd / 32) as uint] |= 1 << (fd % 32);
}
extern {
@ -323,7 +323,7 @@ pub struct fd_set {
}
pub fn fd_set(set: &mut fd_set, fd: i32) {
set.fds_bits[fd / 64] |= (1 << (fd % 64)) as u64;
set.fds_bits[(fd / 64) as uint] |= (1 << (fd % 64)) as u64;
}
extern {

View file

@ -78,7 +78,7 @@ fn helper(input: libc::HANDLE, messages: Receiver<Req>) {
}
} else {
let remove = {
match &chans[idx - 1] {
match &chans[idx as uint - 1] {
&(ref c, oneshot) => !c.try_send(()) || oneshot
}
};

View file

@ -103,7 +103,7 @@ macro_rules! mix(
if use_rsl {
macro_rules! memloop (
($arr:expr) => {{
for i in range_step(0u32, RAND_SIZE, 8) {
for i in range_step(0, RAND_SIZE as uint, 8) {
a+=$arr[i ]; b+=$arr[i+1];
c+=$arr[i+2]; d+=$arr[i+3];
e+=$arr[i+4]; f+=$arr[i+5];
@ -120,7 +120,7 @@ macro_rules! memloop (
memloop!(self.rsl);
memloop!(self.mem);
} else {
for i in range_step(0u32, RAND_SIZE, 8) {
for i in range_step(0, RAND_SIZE as uint, 8) {
mix!();
self.mem[i ]=a; self.mem[i+1]=b;
self.mem[i+2]=c; self.mem[i+3]=d;
@ -143,7 +143,7 @@ fn isaac(&mut self) {
static MIDPOINT: uint = RAND_SIZE as uint / 2;
macro_rules! ind (($x:expr) => {
self.mem[($x >> 2) & (RAND_SIZE - 1)]
self.mem[(($x >> 2) & (RAND_SIZE - 1)) as uint]
});
macro_rules! rngstep(
($j:expr, $shift:expr) => {{
@ -188,7 +188,7 @@ fn next_u32(&mut self) -> u32 {
self.isaac();
}
self.cnt -= 1;
self.rsl[self.cnt]
self.rsl[self.cnt as uint]
}
}

View file

@ -4365,7 +4365,7 @@ fn tycat(cx: &ctxt, ty: t) -> int {
/*bot*/ [t, t, t, t, t, t, t, t],
/*raw ptr*/ [f, f, f, f, t, t, f, f]];
return tbl[tycat(cx, ty)][opcat(op)];
return tbl[tycat(cx, ty) as uint ][opcat(op) as uint];
}
pub fn ty_params_to_tys(tcx: &ctxt, generics: &ast::Generics) -> Vec<t> {

View file

@ -791,7 +791,7 @@ fn listen_ip4() {
Ok(10) => {} e => fail!("{:?}", e),
}
for i in range(0, 10u8) {
assert_eq!(buf[i], i + 1);
assert_eq!(buf[i as uint], i + 1);
}
}
Err(e) => fail!("{:?}", e)
@ -827,7 +827,7 @@ fn listen_ip6() {
Ok(10) => {} e => fail!("{:?}", e),
}
for i in range(0, 10u8) {
assert_eq!(buf[i], i + 1);
assert_eq!(buf[i as uint], i + 1);
}
}
Err(e) => fail!("{:?}", e)
@ -859,7 +859,7 @@ fn udp_recv_ip4() {
e => fail!("{:?}", e),
}
for i in range(0, 10u8) {
assert_eq!(buf[i], i + 1);
assert_eq!(buf[i as uint], i + 1);
}
}
Err(e) => fail!("{:?}", e)
@ -891,7 +891,7 @@ fn udp_recv_ip6() {
e => fail!("{:?}", e),
}
for i in range(0, 10u8) {
assert_eq!(buf[i], i + 1);
assert_eq!(buf[i as uint], i + 1);
}
}
Err(e) => fail!("{:?}", e)

View file

@ -99,10 +99,10 @@ fn to_base64(&self, config: Config) -> ~str {
(self[i + 2] as u32);
// This 24-bit number gets separated into four 6-bit numbers.
v.push(bytes[(n >> 18) & 63]);
v.push(bytes[(n >> 12) & 63]);
v.push(bytes[(n >> 6 ) & 63]);
v.push(bytes[n & 63]);
v.push(bytes[((n >> 18) & 63) as uint]);
v.push(bytes[((n >> 12) & 63) as uint]);
v.push(bytes[((n >> 6 ) & 63) as uint]);
v.push(bytes[(n & 63) as uint]);
cur_length += 4;
i += 3;
@ -125,8 +125,8 @@ fn to_base64(&self, config: Config) -> ~str {
0 => (),
1 => {
let n = (self[i] as u32) << 16;
v.push(bytes[(n >> 18) & 63]);
v.push(bytes[(n >> 12) & 63]);
v.push(bytes[((n >> 18) & 63) as uint]);
v.push(bytes[((n >> 12) & 63) as uint]);
if config.pad {
v.push('=' as u8);
v.push('=' as u8);
@ -135,9 +135,9 @@ fn to_base64(&self, config: Config) -> ~str {
2 => {
let n = (self[i] as u32) << 16 |
(self[i + 1u] as u32) << 8;
v.push(bytes[(n >> 18) & 63]);
v.push(bytes[(n >> 12) & 63]);
v.push(bytes[(n >> 6 ) & 63]);
v.push(bytes[((n >> 18) & 63) as uint]);
v.push(bytes[((n >> 12) & 63) as uint]);
v.push(bytes[((n >> 6 ) & 63) as uint]);
if config.pad {
v.push('=' as u8);
}

View file

@ -41,8 +41,8 @@ impl<'a> ToHex for &'a [u8] {
fn to_hex(&self) -> ~str {
let mut v = slice::with_capacity(self.len() * 2);
for &byte in self.iter() {
v.push(CHARS[byte >> 4]);
v.push(CHARS[byte & 0xf]);
v.push(CHARS[(byte >> 4) as uint]);
v.push(CHARS[(byte & 0xf) as uint]);
}
unsafe {

View file

@ -43,19 +43,19 @@ pub fn to_char(self) -> char {
/// Convert to lowercase.
#[inline]
pub fn to_lower(self) -> Ascii {
Ascii{chr: ASCII_LOWER_MAP[self.chr]}
Ascii{chr: ASCII_LOWER_MAP[self.chr as uint]}
}
/// Convert to uppercase.
#[inline]
pub fn to_upper(self) -> Ascii {
Ascii{chr: ASCII_UPPER_MAP[self.chr]}
Ascii{chr: ASCII_UPPER_MAP[self.chr as uint]}
}
/// Compares two ascii characters of equality, ignoring case.
#[inline]
pub fn eq_ignore_case(self, other: Ascii) -> bool {
ASCII_LOWER_MAP[self.chr] == ASCII_LOWER_MAP[other.chr]
ASCII_LOWER_MAP[self.chr as uint] == ASCII_LOWER_MAP[other.chr as uint]
}
// the following methods are like ctype, and the implementation is inspired by musl
@ -370,8 +370,12 @@ fn to_ascii_lower(&self) -> ~str {
#[inline]
fn eq_ignore_ascii_case(&self, other: &str) -> bool {
self.len() == other.len() && self.as_bytes().iter().zip(other.as_bytes().iter()).all(
|(byte_self, byte_other)| ASCII_LOWER_MAP[*byte_self] == ASCII_LOWER_MAP[*byte_other])
self.len() == other.len() &&
self.as_bytes().iter().zip(other.as_bytes().iter()).all(
|(byte_self, byte_other)| {
ASCII_LOWER_MAP[*byte_self as uint] ==
ASCII_LOWER_MAP[*byte_other as uint]
})
}
}
@ -392,7 +396,7 @@ unsafe fn str_map_bytes(string: ~str, map: &'static [u8]) -> ~str {
let mut bytes = string.into_bytes();
for b in bytes.mut_iter() {
*b = map[*b];
*b = map[*b as uint];
}
str::raw::from_utf8_owned(bytes)
@ -400,7 +404,7 @@ unsafe fn str_map_bytes(string: ~str, map: &'static [u8]) -> ~str {
#[inline]
unsafe fn str_copy_map_bytes(string: &str, map: &'static [u8]) -> ~str {
let bytes = string.bytes().map(|b| map[b]).collect::<~[_]>();
let bytes = string.bytes().map(|b| map[b as uint]).collect::<~[_]>();
str::raw::from_utf8_owned(bytes)
}

View file

@ -254,7 +254,7 @@
macro_rules! test (
{ fn $name:ident() $b:block $(#[$a:meta])*} => (
mod $name {
#[allow(unused_imports)];
#![allow(unused_imports)]
use native;
use comm::*;

View file

@ -432,7 +432,7 @@ fn result_str(h: u64) -> ~str {
assert!(f == i && f == v);
buf.push(t as u8);
state_inc.write_u8(t);
state_inc.write_u8(t as u8);
t += 1;
}

View file

@ -21,7 +21,7 @@
macro_rules! iotest (
{ fn $name:ident() $b:block $(#[$a:meta])* } => (
mod $name {
#[allow(unused_imports)];
#![allow(unused_imports)]
use super::super::*;
use super::*;

View file

@ -1655,7 +1655,7 @@ fn test_checked_mul() {
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 @@ fn $test_name() {
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) {

View file

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

View file

@ -2922,8 +2922,6 @@ mod tests {
fn square(n: uint) -> uint { n * n }
fn square_ref(n: &uint) -> uint { square(*n) }
fn is_odd(n: &uint) -> bool { *n % 2u == 1u }
#[test]
@ -4441,7 +4439,7 @@ fn zero_1kb_loop_set(bh: &mut BenchHarness) {
unsafe {
v.set_len(1024);
}
for i in range(0, 1024) {
for i in range(0u, 1024) {
v[i] = 0;
}
});

View file

@ -1053,7 +1053,7 @@ pub fn with_capacity(capacity: uint) -> ~str {
/// Given a first byte, determine how many bytes are in this UTF-8 character
#[inline]
pub fn utf8_char_width(b: u8) -> uint {
return UTF8_CHAR_WIDTH[b] as uint;
return UTF8_CHAR_WIDTH[b as uint] as uint;
}
/// Struct that contains a `char` and the index of the first byte of
@ -2636,7 +2636,7 @@ fn char_range_at(&self, i: uint) -> CharRange {
// Multibyte case is a fn to allow char_range_at to inline cleanly
fn multibyte_char_range_at(s: &str, i: uint) -> CharRange {
let mut val = s[i] as u32;
let w = UTF8_CHAR_WIDTH[val] as uint;
let w = UTF8_CHAR_WIDTH[val as uint] as uint;
assert!((w != 0));
val = utf8_first_byte!(val, w);
@ -2665,7 +2665,7 @@ fn multibyte_char_range_at_reverse(s: &str, mut i: uint) -> CharRange {
}
let mut val = s[i] as u32;
let w = UTF8_CHAR_WIDTH[val] as uint;
let w = UTF8_CHAR_WIDTH[val as uint] as uint;
assert!((w != 0));
val = utf8_first_byte!(val, w);

View file

@ -780,10 +780,10 @@ pub fn look_ahead<R>(&mut self, distance: uint, f: |&token::Token| -> R)
-> R {
let dist = distance as int;
while self.buffer_length() < dist {
self.buffer[self.buffer_end] = self.reader.next_token();
self.buffer[self.buffer_end as uint] = self.reader.next_token();
self.buffer_end = (self.buffer_end + 1) & 3;
}
f(&self.buffer[(self.buffer_start + dist - 1) & 3].tok)
f(&self.buffer[((self.buffer_start + dist - 1) & 3) as uint].tok)
}
pub fn fatal(&mut self, m: &str) -> ! {
self.sess.span_diagnostic.span_fatal(self.span, m)

View file

@ -293,12 +293,12 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
if cur >= 'A' && cur <= 'Z' {
if stack.len() > 0 {
let idx = (cur as u8) - ('A' as u8);
vars.sta[idx] = stack.pop().unwrap();
vars.sta[idx as uint] = stack.pop().unwrap();
} else { return Err(~"stack is empty") }
} else if cur >= 'a' && cur <= 'z' {
if stack.len() > 0 {
let idx = (cur as u8) - ('a' as u8);
vars.dyn[idx] = stack.pop().unwrap();
vars.dyn[idx as uint] = stack.pop().unwrap();
} else { return Err(~"stack is empty") }
} else {
return Err(~"bad variable name in %P");
@ -307,10 +307,10 @@ pub fn expand(cap: &[u8], params: &[Param], vars: &mut Variables)
GetVar => {
if cur >= 'A' && cur <= 'Z' {
let idx = (cur as u8) - ('A' as u8);
stack.push(vars.sta[idx].clone());
stack.push(vars.sta[idx as uint].clone());
} else if cur >= 'a' && cur <= 'z' {
let idx = (cur as u8) - ('a' as u8);
stack.push(vars.dyn[idx].clone());
stack.push(vars.dyn[idx as uint].clone());
} else {
return Err(~"bad variable name in %g");
}
@ -563,7 +563,6 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,~str> {
mod test {
use super::{expand,String,Variables,Number};
use std::result::Ok;
use std::vec;
#[test]
fn test_basic_setabf() {

View file

@ -223,7 +223,7 @@ macro_rules! try( ($e:expr) => (
if b < 0 {
return Err(~"error: expected more bools but hit EOF");
} else if b == 1 {
bools_map.insert(bnames[i].to_owned(), true);
bools_map.insert(bnames[i as uint].to_owned(), true);
}
}
}
@ -237,7 +237,7 @@ macro_rules! try( ($e:expr) => (
for i in range(0, numbers_count) {
let n = try!(file.read_le_u16());
if n != 0xFFFF {
numbers_map.insert(nnames[i].to_owned(), n);
numbers_map.insert(nnames[i as uint].to_owned(), n);
}
}
}

View file

@ -58,8 +58,9 @@ fn new() -> Noise2DContext {
}
fn get_gradient(&self, x: i32, y: i32) -> Vec2 {
let idx = self.permutations[x & 255] + self.permutations[y & 255];
self.rgradients[idx & 255]
let idx = self.permutations[(x & 255) as uint] +
self.permutations[(y & 255) as uint];
self.rgradients[(idx & 255) as uint]
}
fn get_gradients(&self, x: f32, y: f32) -> ([Vec2, ..4], [Vec2, ..4]) {
@ -103,16 +104,16 @@ fn main() {
let n2d = Noise2DContext::new();
for _ in range(0, 100) {
for y in range(0, 256) {
for x in range(0, 256) {
for y in range(0u, 256) {
for x in range(0u, 256) {
let v = n2d.get(x as f32 * 0.1, y as f32 * 0.1);
pixels[y*256+x] = v * 0.5 + 0.5;
}
}
}
for y in range(0, 256) {
for x in range(0, 256) {
for y in range(0u, 256) {
for x in range(0u, 256) {
let idx = (pixels[y*256+x] / 0.2) as uint;
print!("{:c}", symbols[idx]);
}

View file

@ -30,7 +30,7 @@ fn fannkuch_redux(n: i32) -> i32 {
let mut r = n;
loop {
while r != 1 {
count[r - 1] = r;
count[r as uint - 1] = r;
r -= 1;
}
@ -71,13 +71,13 @@ fn fannkuch_redux(n: i32) -> i32 {
let mut i: i32 = 0;
while i < r {
let j = i + 1;
perm1[i] = perm1[j];
perm1[i as uint] = perm1[j as uint];
i = j;
}
perm1[r] = perm0;
perm1[r as uint] = perm0;
count[r] -= 1;
if count[r] > 0 {
count[r as uint] -= 1;
if count[r as uint] > 0 {
break;
}
r += 1;

View file

@ -201,7 +201,7 @@ fn pack_symbol(c: u8) -> u8 {
}
fn unpack_symbol(c: u8) -> u8 {
TABLE[c]
TABLE[c as uint]
}
fn generate_frequencies(frequencies: &mut Table,

View file

@ -255,9 +255,9 @@ fn search(
// for every unused piece
for id in range(0, 10).filter(|id| board & (1 << (id + 50)) == 0) {
// for each mask that fits on the board
for &m in masks[id].get(i as uint)
.iter()
.filter(|&m| board & *m == 0) {
for &m in masks[id as uint].get(i as uint)
.iter()
.filter(|&m| board & *m == 0) {
// This check is too costy.
//if is_board_unfeasible(board | m, masks) {continue;}
if !search(masks, board | m, i + 1, Cons(m, &cur), data) {

View file

@ -29,8 +29,8 @@ fn make_complements() -> [u8, ..256] {
}
let lower = 'A' as u8 - 'a' as u8;
for &(from, to) in transforms.iter() {
complements[from as u8] = to as u8;
complements[from as u8 - lower] = to as u8;
complements[from as uint] = to as u8;
complements[(from as u8 - lower) as uint] = to as u8;
}
complements
}
@ -70,11 +70,11 @@ fn main() {
loop {
match (it.next(), it.next_back()) {
(Some(front), Some(back)) => {
let tmp = complements[*front];
*front = complements[*back];
let tmp = complements[*front as uint];
*front = complements[*back as uint];
*back = tmp;
}
(Some(last), None) => *last = complements[*last], // last element
(Some(last), None) => *last = complements[*last as uint], // last element
_ => break // vector exhausted.
}
}

View file

@ -0,0 +1,26 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub fn main() {
let v: Vec<int> = vec!(0, 1, 2, 3, 4, 5);
let s: ~str = ~"abcdef";
assert_eq!(v.as_slice()[3u], 3);
assert_eq!(v.as_slice()[3u8], 3); //~ ERROR: mismatched types
assert_eq!(v.as_slice()[3i8], 3); //~ ERROR: mismatched types
assert_eq!(v.as_slice()[3u32], 3); //~ ERROR: mismatched types
assert_eq!(v.as_slice()[3i32], 3); //~ ERROR: mismatched types
println!("{}", v.as_slice()[3u8]); //~ ERROR: mismatched types
assert_eq!(s[3u], 'd' as u8);
assert_eq!(s[3u8], 'd' as u8); //~ ERROR: mismatched types
assert_eq!(s[3i8], 'd' as u8); //~ ERROR: mismatched types
assert_eq!(s[3u32], 'd' as u8); //~ ERROR: mismatched types
assert_eq!(s[3i32], 'd' as u8); //~ ERROR: mismatched types
println!("{}", s[3u8]); //~ ERROR: mismatched types
}

View file

@ -211,8 +211,8 @@
// check:$57 = 10
// debugger:continue
#[allow(unused_variable)];
#[allow(dead_assignment)];
#![allow(unused_variable)]
#![allow(dead_assignment)]
static mut MUT_INT: int = 0;
@ -366,7 +366,7 @@ fn main() {
zzz();
sentinel();
val
val as uint
}];
zzz();

View file

@ -51,7 +51,7 @@ pub fn main() {
// Now try it with a type that *needs* to be borrowed
let z = [0,1,2,3];
// Call a method
z.iterate(|y| { assert!(z[*y] == *y); true });
z.iterate(|y| { assert!(z[*y as uint] == *y); true });
// Call a parameterized function
assert_eq!(length::<int, &[int]>(z), z.len());
}

View file

@ -1,28 +0,0 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// This is a testcase for issue #94.
pub fn main() {
let v: Vec<int> = vec!(0, 1, 2, 3, 4, 5);
let s: ~str = ~"abcdef";
assert_eq!(v.as_slice()[3u], 3);
assert_eq!(v.as_slice()[3u8], 3);
assert_eq!(v.as_slice()[3i8], 3);
assert_eq!(v.as_slice()[3u32], 3);
assert_eq!(v.as_slice()[3i32], 3);
println!("{}", v.as_slice()[3u8]);
assert_eq!(s[3u], 'd' as u8);
assert_eq!(s[3u8], 'd' as u8);
assert_eq!(s[3i8], 'd' as u8);
assert_eq!(s[3u32], 'd' as u8);
assert_eq!(s[3i32], 'd' as u8);
println!("{}", s[3u8]);
}

View file

@ -44,7 +44,7 @@ fn check_str_eq(a: ~str, b: ~str) {
for ab in a.bytes() {
println!("{}", i);
println!("{}", ab);
let bb: u8 = b[i];
let bb: u8 = b[i as uint];
println!("{}", bb);
assert_eq!(ab, bb);
i += 1;