]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/lint-unused-mut-variables.rs
test: Automatically remove all `~[T]` from tests.
[rust.git] / src / test / compile-fail / lint-unused-mut-variables.rs
index 6b6311739f05c095ccd1231b083105485585b444..275b37d9b7e4986aeaca269173a91124f07ab6cf 100644 (file)
@@ -21,7 +21,7 @@ fn main() {
     let mut a = 3; //~ ERROR: variable does not need to be mutable
     let mut a = 2; //~ ERROR: variable does not need to be mutable
     let mut b = 3; //~ ERROR: variable does not need to be mutable
-    let mut a = ~[3]; //~ ERROR: variable does not need to be mutable
+    let mut a = vec!(3); //~ ERROR: variable does not need to be mutable
     let (mut a, b) = (1, 2); //~ ERROR: variable does not need to be mutable
 
     match 30 {
@@ -34,9 +34,9 @@ fn what(mut foo: int) {} //~ ERROR: variable does not need to be mutable
     // positive cases
     let mut a = 2;
     a = 3;
-    let mut a = ~[];
+    let mut a = Vec::new();
     a.push(3);
-    let mut a = ~[];
+    let mut a = Vec::new();
     callback(|| {
         a.push(3);
     });
@@ -63,5 +63,5 @@ fn callback(f: ||) {}
 #[allow(unused_mut)]
 fn foo(mut a: int) {
     let mut a = 3;
-    let mut b = ~[2];
+    let mut b = vec!(2);
 }