]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/assignability-trait.rs
test: Make manual changes to deal with the fallout from removal of
[rust.git] / src / test / run-pass / assignability-trait.rs
index aa3e28c875e402f8d8b54ffaba35e9f454d69c81..60a7101c8201db4ba3ce647db72c841e5cb1431b 100644 (file)
@@ -12,6 +12,8 @@
 // making method calls, but only if there aren't any matches without
 // it.
 
+use std::vec_ng::Vec;
+
 trait iterable<A> {
     fn iterate(&self, blk: |x: &A| -> bool) -> bool;
 }
@@ -38,14 +40,14 @@ fn length<A, T: iterable<A>>(x: T) -> uint {
 }
 
 pub fn main() {
-    let x = vec!(0,1,2,3);
+    let x: Vec<int> = vec!(0,1,2,3);
     // Call a method
-    x.iterate(|y| { assert!(x[*y] == *y); true });
+    x.iterate(|y| { assert!(*x.get(*y as uint) == *y); true });
     // Call a parameterized function
     assert_eq!(length(x.clone()), x.len());
     // Call a parameterized function, with type arguments that require
     // a borrow
-    assert_eq!(length::<int, &[int]>(x), x.len());
+    assert_eq!(length::<int, &[int]>(x.as_slice()), x.len());
 
     // Now try it with a type that *needs* to be borrowed
     let z = [0,1,2,3];