#[cfg(target_arch="x86")]
fn main() {
- let x = ~[1u,2u,3u];
+ let x = vec!(1u,2u,3u);
// This should cause a bounds-check failure, but may not if we do our
// bounds checking by truncating the index value to the size of the
idx as uint);
// This should fail.
- println!("ov3 0x%x", x[idx]);
+ println!("ov3 0x%x", x.as_slice()[idx]);
}
#[cfg(target_arch="x86_64")]
fn main() {
// This version just fails anyways, for symmetry on 64-bit hosts.
- let x = ~[1u,2u,3u];
- println!("ov3 0x%x", x[200]);
+ let x = vec!(1u,2u,3u);
+ error!("ov3 0x%x", x.as_slice()[200]);
}