about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-02-16 19:56:33 -0800
committerbors <bors@rust-lang.org>2013-02-16 19:56:33 -0800
commitaa8af12228f023877ab9f6c39878f95a8ee05bf9 (patch)
treeb3a6e8629f16bf2cfb8503886baf6f20fe5cc9f9
parent945ac428b8d254368521ab3a3f7fb63482dc3aa0 (diff)
parent60bd4a5385ae39085d82a89ac6bc7bb9cd9b200b (diff)
downloadrust-aa8af12228f023877ab9f6c39878f95a8ee05bf9.tar.gz
rust-aa8af12228f023877ab9f6c39878f95a8ee05bf9.zip
auto merge of #4995 : sethpink/rust/obsolete-capture-clause, r=graydon
Remove capture clause use. I think I got them all.
-rw-r--r--src/librustc/middle/astencode.rs2
-rw-r--r--src/librustdoc/text_pass.rs4
-rw-r--r--src/librustdoc/tystr_pass.rs4
-rw-r--r--src/librusti/rusti.rc2
-rw-r--r--src/libstd/future.rs2
-rw-r--r--src/libstd/par.rs6
-rw-r--r--src/test/auxiliary/cci_capture_clause.rs2
-rw-r--r--src/test/compile-fail/kindck-nonsendable-1.rs2
-rw-r--r--src/test/run-pass/capture_nil.rs2
-rw-r--r--src/test/run-pass/issue-3609.rs1
10 files changed, 13 insertions, 14 deletions
diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs
index da58062f553..e992c2a3af7 100644
--- a/src/librustc/middle/astencode.rs
+++ b/src/librustc/middle/astencode.rs
@@ -821,7 +821,7 @@ fn encode_side_tables_for_ii(ecx: @e::encode_ctxt,
         let ebml_w = copy ebml_w;
         ast_util::visit_ids_for_inlined_item(
             ii,
-            fn@(id: ast::node_id, copy ebml_w) {
+            fn@(id: ast::node_id) {
                 // Note: this will cause a copy of ebml_w, which is bad as
                 // it has mut fields.  But I believe it's harmless since
                 // we generate balanced EBML.
diff --git a/src/librustdoc/text_pass.rs b/src/librustdoc/text_pass.rs
index ab1d77a36db..b9dbe523fdd 100644
--- a/src/librustdoc/text_pass.rs
+++ b/src/librustdoc/text_pass.rs
@@ -76,7 +76,7 @@ fn apply_to_sections(
     op: NominalOp<Op>,
     sections: ~[doc::Section]
 ) -> ~[doc::Section] {
-    sections.map(|section, copy op| doc::Section {
+    sections.map(|section| doc::Section {
         header: (op.op)(copy section.header),
         body: (op.op)(copy section.body)
     })
@@ -89,7 +89,7 @@ fn fold_enum(
     let fold_copy = copy *fold;
 
     doc::EnumDoc {
-        variants: do doc.variants.map |variant, copy fold_copy| {
+        variants: do doc.variants.map |variant| {
             doc::VariantDoc {
                 desc: maybe_apply_op(copy fold_copy.ctxt, &variant.desc),
                 .. copy *variant
diff --git a/src/librustdoc/tystr_pass.rs b/src/librustdoc/tystr_pass.rs
index 42961e7bca6..b39cee87525 100644
--- a/src/librustdoc/tystr_pass.rs
+++ b/src/librustdoc/tystr_pass.rs
@@ -137,7 +137,7 @@ fn fold_enum(
         variants: do vec::map(doc.variants) |variant| {
             let sig = {
                 let variant = copy *variant;
-                do astsrv::exec(srv.clone()) |copy variant, ctxt| {
+                do astsrv::exec(srv.clone()) |ctxt| {
                     match ctxt.ast_map.get(&doc_id) {
                         ast_map::node_item(@ast::item {
                             node: ast::item_enum(ref enum_definition, _), _
@@ -198,7 +198,7 @@ fn get_method_sig(
     item_id: doc::AstId,
     method_name: ~str
 ) -> Option<~str> {
-    do astsrv::exec(srv) |copy method_name, ctxt| {
+    do astsrv::exec(srv) |ctxt| {
         match ctxt.ast_map.get(&item_id) {
           ast_map::node_item(@ast::item {
             node: ast::item_trait(_, _, ref methods), _
diff --git a/src/librusti/rusti.rc b/src/librusti/rusti.rc
index dead9ca58fc..cd479aadb25 100644
--- a/src/librusti/rusti.rc
+++ b/src/librusti/rusti.rc
@@ -368,7 +368,7 @@ fn run_line(repl: &mut Repl, in: io::Reader, out: io::Writer, line: ~str)
     }
 
     let r = *repl;
-    let result = do task::try |copy r| {
+    let result = do task::try {
         run(r, line)
     };
 
diff --git a/src/libstd/future.rs b/src/libstd/future.rs
index e8c9a568a96..ff81393a914 100644
--- a/src/libstd/future.rs
+++ b/src/libstd/future.rs
@@ -202,7 +202,7 @@ pub mod test {
     #[test]
     pub fn test_sendable_future() {
         let expected = ~"schlorf";
-        let f = do spawn |copy expected| { copy expected };
+        let f = do spawn { copy expected };
         do task::spawn || {
             let actual = f.get();
             assert actual == expected;
diff --git a/src/libstd/par.rs b/src/libstd/par.rs
index 3929e8c0ea7..c48f56dd143 100644
--- a/src/libstd/par.rs
+++ b/src/libstd/par.rs
@@ -107,7 +107,7 @@ pub fn mapi<A: Copy Owned, B: Copy Owned>(
 {
     let slices = map_slices(xs, || {
         let f = fn_factory();
-        fn~(base: uint, slice : &[A], copy f) -> ~[B] {
+        fn~(base: uint, slice : &[A]) -> ~[B] {
             vec::mapi(slice, |i, x| {
                 f(i + base, x)
             })
@@ -126,7 +126,7 @@ pub fn alli<A: Copy Owned>(
 {
     do vec::all(map_slices(xs, || {
         let f = fn_factory();
-        fn~(base: uint, slice : &[A], copy f) -> bool {
+        fn~(base: uint, slice : &[A]) -> bool {
             vec::alli(slice, |i, x| {
                 f(i + base, x)
             })
@@ -140,7 +140,7 @@ pub fn any<A: Copy Owned>(
     fn_factory: &fn() -> ~fn(&A) -> bool) -> bool {
     do vec::any(map_slices(xs, || {
         let f = fn_factory();
-        fn~(_base : uint, slice: &[A], copy f) -> bool {
+        fn~(_base : uint, slice: &[A]) -> bool {
             vec::any(slice, |x| f(x))
         }
     })) |x| { *x }
diff --git a/src/test/auxiliary/cci_capture_clause.rs b/src/test/auxiliary/cci_capture_clause.rs
index fd319aacd05..70a2b8f680a 100644
--- a/src/test/auxiliary/cci_capture_clause.rs
+++ b/src/test/auxiliary/cci_capture_clause.rs
@@ -12,7 +12,7 @@ use core::pipes::*;
 
 pub fn foo<T: Owned Copy>(x: T) -> Port<T> {
     let (p, c) = stream();
-    do task::spawn() |copy x| {
+    do task::spawn() {
         c.send(x);
     }
     p
diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs
index c88dae232fa..397b0f682d6 100644
--- a/src/test/compile-fail/kindck-nonsendable-1.rs
+++ b/src/test/compile-fail/kindck-nonsendable-1.rs
@@ -13,6 +13,6 @@ fn foo(_x: @uint) {}
 fn main() {
     let x = @3u;
     let _ = fn~() { foo(x); }; //~ ERROR value has non-owned type `@uint`
-    let _ = fn~(copy x) { foo(x); }; //~ ERROR value has non-owned type `@uint`
+    let _ = fn~() { foo(x); }; //~ ERROR value has non-owned type `@uint`
     let _ = fn~() { foo(x); }; //~ ERROR value has non-owned type `@uint`
 }
diff --git a/src/test/run-pass/capture_nil.rs b/src/test/run-pass/capture_nil.rs
index 6c052b95a2b..b77e91c8d21 100644
--- a/src/test/run-pass/capture_nil.rs
+++ b/src/test/run-pass/capture_nil.rs
@@ -28,7 +28,7 @@ use core::pipes::*;
 
 fn foo(&&x: ()) -> Port<()> {
     let (p, c) = stream::<()>();
-    do task::spawn() |copy x| {
+    do task::spawn() {
         c.send(x);
     }
     p
diff --git a/src/test/run-pass/issue-3609.rs b/src/test/run-pass/issue-3609.rs
index 0eacb34b1ef..6eb540c4737 100644
--- a/src/test/run-pass/issue-3609.rs
+++ b/src/test/run-pass/issue-3609.rs
@@ -12,7 +12,6 @@ enum Msg
 
 fn foo(name: ~str, samples_chan: Chan<Msg>) {
     do task::spawn
-    |copy name|
     {
         let callback: SamplesFn =
             |buffer|