about summary refs log tree commit diff
path: root/src/libextra
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/libextra
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/libextra')
-rw-r--r--src/libextra/arena.rs4
-rw-r--r--src/libextra/ebml.rs8
-rw-r--r--src/libextra/net/ip.rs8
-rw-r--r--src/libextra/net/tcp.rs4
4 files changed, 13 insertions, 11 deletions
diff --git a/src/libextra/arena.rs b/src/libextra/arena.rs
index f137b573c55..4ada3bcb6b5 100644
--- a/src/libextra/arena.rs
+++ b/src/libextra/arena.rs
@@ -177,7 +177,7 @@ impl Arena {
         // Allocate a new chunk.
         let chunk_size = at_vec::capacity(self.pod_head.data);
         let new_min_chunk_size = num::max(n_bytes, chunk_size);
-        self.chunks = @mut MutCons(copy self.pod_head, self.chunks);
+        self.chunks = @mut MutCons(self.pod_head, self.chunks);
         self.pod_head =
             chunk(uint::next_power_of_two(new_min_chunk_size + 1u), true);
 
@@ -219,7 +219,7 @@ impl Arena {
         // Allocate a new chunk.
         let chunk_size = at_vec::capacity(self.head.data);
         let new_min_chunk_size = num::max(n_bytes, chunk_size);
-        self.chunks = @mut MutCons(copy self.head, self.chunks);
+        self.chunks = @mut MutCons(self.head, self.chunks);
         self.head =
             chunk(uint::next_power_of_two(new_min_chunk_size + 1u), false);
 
diff --git a/src/libextra/ebml.rs b/src/libextra/ebml.rs
index 502e45e1d47..1ad44c5e28c 100644
--- a/src/libextra/ebml.rs
+++ b/src/libextra/ebml.rs
@@ -318,8 +318,12 @@ pub mod reader {
             let TaggedDoc { tag: r_tag, doc: r_doc } =
                 doc_at(self.parent.data, self.pos);
             debug!("self.parent=%?-%? self.pos=%? r_tag=%? r_doc=%?-%?",
-                   copy self.parent.start, copy self.parent.end,
-                   copy self.pos, r_tag, r_doc.start, r_doc.end);
+                   self.parent.start,
+                   self.parent.end,
+                   self.pos,
+                   r_tag,
+                   r_doc.start,
+                   r_doc.end);
             if r_tag != (exp_tag as uint) {
                 fail!("expected EBML doc with tag %? but found tag %?", exp_tag, r_tag);
             }
diff --git a/src/libextra/net/ip.rs b/src/libextra/net/ip.rs
index 11e3106e4b5..f6516fad6b8 100644
--- a/src/libextra/net/ip.rs
+++ b/src/libextra/net/ip.rs
@@ -240,7 +240,7 @@ pub mod v4 {
                     err_msg: ~"uv_ip4_name produced invalid result.",
                 })
             } else {
-                Ok(Ipv4(copy(new_addr)))
+                Ok(Ipv4(new_addr))
             }
         }
     }
@@ -312,12 +312,10 @@ extern fn get_addr_cb(handle: *uv_getaddrinfo_t,
                 let mut curr_addr = res;
                 loop {
                     let new_ip_addr = if ll::is_ipv4_addrinfo(curr_addr) {
-                        Ipv4(copy((
-                            *ll::addrinfo_as_sockaddr_in(curr_addr))))
+                        Ipv4(*ll::addrinfo_as_sockaddr_in(curr_addr))
                     }
                     else if ll::is_ipv6_addrinfo(curr_addr) {
-                        Ipv6(copy((
-                            *ll::addrinfo_as_sockaddr_in6(curr_addr))))
+                        Ipv6(*ll::addrinfo_as_sockaddr_in6(curr_addr))
                     }
                     else {
                         debug!("curr_addr is not of family AF_INET or \
diff --git a/src/libextra/net/tcp.rs b/src/libextra/net/tcp.rs
index fd80d8e0465..d262304298d 100644
--- a/src/libextra/net/tcp.rs
+++ b/src/libextra/net/tcp.rs
@@ -682,8 +682,8 @@ fn listen_common(host_ip: ip::IpAddr,
     // will defeat a move sigil, as is done to the host_ip
     // arg above.. this same pattern works w/o complaint in
     // tcp::connect (because the iotask::interact cb isn't
-    // nested within a std::comm::listen block)
-    let loc_ip = copy(host_ip);
+    // nested within a core::comm::listen block)
+    let loc_ip = host_ip;
     do iotask::interact(iotask) |loop_ptr| {
         unsafe {
             match uv::ll::tcp_init(loop_ptr, server_stream_ptr) {