]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-fail/bug-2470-bounds-check-overflow-3.rs
test: Automatically remove all `~[T]` from tests.
[rust.git] / src / test / run-fail / bug-2470-bounds-check-overflow-3.rs
index e262d088ba018477c9f6b2b79192f66c7255cd4b..6106abc76c3f7259a823c610d8f2fdaf04968dd2 100644 (file)
@@ -15,7 +15,7 @@
 
 #[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
@@ -29,12 +29,12 @@ fn main() {
            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]);
 }