about summary refs log tree commit diff
path: root/src/libstd
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/libstd
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/libstd')
-rw-r--r--src/libstd/cleanup.rs8
-rw-r--r--src/libstd/pipes.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/cleanup.rs b/src/libstd/cleanup.rs
index abda76c9ca6..353038a1a19 100644
--- a/src/libstd/cleanup.rs
+++ b/src/libstd/cleanup.rs
@@ -38,9 +38,9 @@ unsafe fn each_live_alloc(read_next_before: bool,
     use rt::local_heap;
 
     let box = local_heap::live_allocs();
-    let mut box: *mut BoxRepr = transmute(copy box);
+    let mut box: *mut BoxRepr = transmute(box);
     while box != mut_null() {
-        let next_before = transmute(copy (*box).header.next);
+        let next_before = transmute((*box).header.next);
         let uniq =
             (*box).header.ref_count == managed::raw::RC_MANAGED_UNIQUE;
 
@@ -51,7 +51,7 @@ unsafe fn each_live_alloc(read_next_before: bool,
         if read_next_before {
             box = next_before;
         } else {
-            box = transmute(copy (*box).header.next);
+            box = transmute((*box).header.next);
         }
     }
     return true;
@@ -126,7 +126,7 @@ pub unsafe fn annihilate() {
     // callback, as the original value may have been freed.
     for each_live_alloc(false) |box, uniq| {
         if !uniq {
-            let tydesc: *TyDesc = transmute(copy (*box).header.type_desc);
+            let tydesc: *TyDesc = transmute((*box).header.type_desc);
             let data = transmute(&(*box).data);
             call_drop_glue(tydesc, data);
         }
diff --git a/src/libstd/pipes.rs b/src/libstd/pipes.rs
index 49713a3a23b..8f43e847c24 100644
--- a/src/libstd/pipes.rs
+++ b/src/libstd/pipes.rs
@@ -476,7 +476,7 @@ fn try_recv_<T:Send>(p: &mut Packet<T>) -> Option<T> {
                 // sometimes blocking the thing we are waiting on.
                 task::yield();
             }
-            debug!("woke up, p.state = %?", copy p.header.state);
+            debug!("woke up, p.state = %?", p.header.state);
           }
           Blocked => if first {
             fail!("blocking on already blocked packet")