about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-06-27 17:41:35 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-07-17 14:56:42 -0700
commitb4e674f6e662bc80f2e7a5a1a9834f2152f08d32 (patch)
tree1b567620d7ea1641fa58338b8f6e5c68bb324248 /src/test
parent8c082658bed1877d5741f7badceb8efc3015598d (diff)
downloadrust-b4e674f6e662bc80f2e7a5a1a9834f2152f08d32.tar.gz
rust-b4e674f6e662bc80f2e7a5a1a9834f2152f08d32.zip
librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/class-cast-to-trait-multiple-types.rs2
-rw-r--r--src/test/run-pass/explicit-self.rs2
-rw-r--r--src/test/run-pass/expr-copy.rs2
-rw-r--r--src/test/run-pass/expr-repeat-vstore.rs10
-rw-r--r--src/test/run-pass/exterior.rs2
-rw-r--r--src/test/run-pass/issue-2633.rs2
-rw-r--r--src/test/run-pass/ivec-add.rs2
-rw-r--r--src/test/run-pass/lambda-infer-unresolved.rs2
-rw-r--r--src/test/run-pass/morestack6.rs2
-rw-r--r--src/test/run-pass/nullable-pointer-iotareduction.rs2
10 files changed, 13 insertions, 15 deletions
diff --git a/src/test/run-pass/class-cast-to-trait-multiple-types.rs b/src/test/run-pass/class-cast-to-trait-multiple-types.rs
index 475915cf964..56c70e78092 100644
--- a/src/test/run-pass/class-cast-to-trait-multiple-types.rs
+++ b/src/test/run-pass/class-cast-to-trait-multiple-types.rs
@@ -89,7 +89,7 @@ pub fn main() {
   let nyan : cat  = cat(0u, 2, ~"nyan");
   let whitefang : dog = dog();
   annoy_neighbors(@(copy nyan) as @noisy);
-  annoy_neighbors(@(copy whitefang) as @noisy);
+  annoy_neighbors(@whitefang as @noisy);
   assert_eq!(nyan.meow_count(), 10u);
   assert_eq!(*whitefang.volume, 1);
 }
diff --git a/src/test/run-pass/explicit-self.rs b/src/test/run-pass/explicit-self.rs
index 25e40402161..9a4519786e9 100644
--- a/src/test/run-pass/explicit-self.rs
+++ b/src/test/run-pass/explicit-self.rs
@@ -50,7 +50,7 @@ struct A { a: @int }
 
 fn thing(x: A) -> thing {
     thing {
-        x: copy x
+        x: x
     }
 }
 
diff --git a/src/test/run-pass/expr-copy.rs b/src/test/run-pass/expr-copy.rs
index 96dab798c83..4bc8d1f86de 100644
--- a/src/test/run-pass/expr-copy.rs
+++ b/src/test/run-pass/expr-copy.rs
@@ -21,7 +21,7 @@ pub fn main() {
     f(&mut x);
     assert_eq!(x.a, 100);
     x.a = 20;
-    let mut y = copy x;
+    let mut y = x;
     f(&mut y);
     assert_eq!(x.a, 20);
 }
diff --git a/src/test/run-pass/expr-repeat-vstore.rs b/src/test/run-pass/expr-repeat-vstore.rs
index 57587936022..5c94f059b49 100644
--- a/src/test/run-pass/expr-repeat-vstore.rs
+++ b/src/test/run-pass/expr-repeat-vstore.rs
@@ -14,9 +14,9 @@ fn main() {
     println(v[3].to_str());
     println(v[4].to_str());
     let v: @mut [int] = @mut [ 3, ..5 ];
-    println((copy v[0]).to_str());
-    println((copy v[1]).to_str());
-    println((copy v[2]).to_str());
-    println((copy v[3]).to_str());
-    println((copy v[4]).to_str());
+    println((v[0]).to_str());
+    println((v[1]).to_str());
+    println((v[2]).to_str());
+    println((v[3]).to_str());
+    println((v[4]).to_str());
 }
diff --git a/src/test/run-pass/exterior.rs b/src/test/run-pass/exterior.rs
index 409fec5656c..43f14b790ac 100644
--- a/src/test/run-pass/exterior.rs
+++ b/src/test/run-pass/exterior.rs
@@ -18,7 +18,7 @@ fn f(p: @mut Point) { assert!((p.z == 12)); p.z = 13; assert!((p.z == 13)); }
 
 pub fn main() {
     let a: Point = Point {x: 10, y: 11, z: 12};
-    let b: @mut Point = @mut copy a;
+    let b: @mut Point = @mut a;
     assert_eq!(b.z, 12);
     f(b);
     assert_eq!(a.z, 12);
diff --git a/src/test/run-pass/issue-2633.rs b/src/test/run-pass/issue-2633.rs
index 2eb63102224..c86ce953de5 100644
--- a/src/test/run-pass/issue-2633.rs
+++ b/src/test/run-pass/issue-2633.rs
@@ -27,5 +27,5 @@ fn nyan(kitty: cat, _kitty_info: KittyInfo) {
 
 pub fn main() {
     let mut kitty = cat();
-    nyan(copy kitty, KittyInfo {kitty: copy kitty});
+    nyan(kitty, KittyInfo {kitty: kitty});
 }
diff --git a/src/test/run-pass/ivec-add.rs b/src/test/run-pass/ivec-add.rs
index 7cee6b4e8de..590be377691 100644
--- a/src/test/run-pass/ivec-add.rs
+++ b/src/test/run-pass/ivec-add.rs
@@ -10,7 +10,7 @@
 
 fn double<T:Copy>(a: T) -> ~[T] { return ~[copy a] + ~[a]; }
 
-fn double_int(a: int) -> ~[int] { return ~[copy a] + ~[a]; }
+fn double_int(a: int) -> ~[int] { return ~[a] + ~[a]; }
 
 pub fn main() {
     let mut d = double(1);
diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs
index 4aeeda8312c..056e3a4ff49 100644
--- a/src/test/run-pass/lambda-infer-unresolved.rs
+++ b/src/test/run-pass/lambda-infer-unresolved.rs
@@ -16,6 +16,6 @@ struct Refs { refs: ~[int], n: int }
 
 pub fn main() {
     let e = @mut Refs{refs: ~[], n: 0};
-    let f: @fn() = || error!(copy e.n);
+    let f: @fn() = || error!(e.n);
     e.refs.push(1);
 }
diff --git a/src/test/run-pass/morestack6.rs b/src/test/run-pass/morestack6.rs
index a46b7a3dfcf..b7612592830 100644
--- a/src/test/run-pass/morestack6.rs
+++ b/src/test/run-pass/morestack6.rs
@@ -43,7 +43,7 @@ fn runtest2(f: extern fn(), frame_backoff: u32, last_stk: *u8) -> u32 {
             // We switched stacks, go back and try to hit the dynamic linker
             frame_backoff
         } else {
-            let frame_backoff = runtest2(copy f, frame_backoff, curr_stk);
+            let frame_backoff = runtest2(f, frame_backoff, curr_stk);
             if frame_backoff > 1u32 {
                 frame_backoff - 1u32
             } else if frame_backoff == 1u32 {
diff --git a/src/test/run-pass/nullable-pointer-iotareduction.rs b/src/test/run-pass/nullable-pointer-iotareduction.rs
index b63870dcfb6..e557fae7ac9 100644
--- a/src/test/run-pass/nullable-pointer-iotareduction.rs
+++ b/src/test/run-pass/nullable-pointer-iotareduction.rs
@@ -36,7 +36,6 @@ impl<T> E<T> {
 
 macro_rules! check_option {
     ($e:expr: $T:ty) => {{
-        // FIXME #6000: remove the copy
         check_option!(copy $e: $T, |ptr| assert!(*ptr == $e));
     }};
     ($e:expr: $T:ty, |$v:ident| $chk:expr) => {{
@@ -49,7 +48,6 @@ macro_rules! check_option {
 
 macro_rules! check_fancy {
     ($e:expr: $T:ty) => {{
-        // FIXME #6000: remove the copy
         check_fancy!(copy $e: $T, |ptr| assert!(*ptr == $e));
     }};
     ($e:expr: $T:ty, |$v:ident| $chk:expr) => {{