From b4e674f6e662bc80f2e7a5a1a9834f2152f08d32 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 27 Jun 2013 17:41:35 -0700 Subject: librustc: Add a lint mode for unnecessary `copy` and remove a bunch of them. --- src/libstd/cleanup.rs | 8 ++++---- src/libstd/pipes.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libstd') 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_(p: &mut Packet) -> Option { // 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") -- cgit 1.4.1-3-g733a5