Skip to content

Commit 1f4c758

Browse files
committed
Remove use of capture clause #4965
1 parent 945ac42 commit 1f4c758

File tree

7 files changed

+8
-9
lines changed

7 files changed

+8
-9
lines changed

src/librustdoc/text_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn apply_to_sections(
7676
op: NominalOp<Op>,
7777
sections: ~[doc::Section]
7878
) -> ~[doc::Section] {
79-
sections.map(|section, copy op| doc::Section {
79+
sections.map(|section| doc::Section {
8080
header: (op.op)(copy section.header),
8181
body: (op.op)(copy section.body)
8282
})
@@ -89,7 +89,7 @@ fn fold_enum(
8989
let fold_copy = copy *fold;
9090

9191
doc::EnumDoc {
92-
variants: do doc.variants.map |variant, copy fold_copy| {
92+
variants: do doc.variants.map |variant| {
9393
doc::VariantDoc {
9494
desc: maybe_apply_op(copy fold_copy.ctxt, &variant.desc),
9595
.. copy *variant

src/librustdoc/tystr_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ fn fold_enum(
137137
variants: do vec::map(doc.variants) |variant| {
138138
let sig = {
139139
let variant = copy *variant;
140-
do astsrv::exec(srv.clone()) |copy variant, ctxt| {
140+
do astsrv::exec(srv.clone()) |ctxt| {
141141
match ctxt.ast_map.get(&doc_id) {
142142
ast_map::node_item(@ast::item {
143143
node: ast::item_enum(ref enum_definition, _), _
@@ -198,7 +198,7 @@ fn get_method_sig(
198198
item_id: doc::AstId,
199199
method_name: ~str
200200
) -> Option<~str> {
201-
do astsrv::exec(srv) |copy method_name, ctxt| {
201+
do astsrv::exec(srv) |ctxt| {
202202
match ctxt.ast_map.get(&item_id) {
203203
ast_map::node_item(@ast::item {
204204
node: ast::item_trait(_, _, ref methods), _

src/librusti/rusti.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ fn run_line(repl: &mut Repl, in: io::Reader, out: io::Writer, line: ~str)
368368
}
369369

370370
let r = *repl;
371-
let result = do task::try |copy r| {
371+
let result = do task::try {
372372
run(r, line)
373373
};
374374

src/libstd/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub mod test {
202202
#[test]
203203
pub fn test_sendable_future() {
204204
let expected = ~"schlorf";
205-
let f = do spawn |copy expected| { copy expected };
205+
let f = do spawn { copy expected };
206206
do task::spawn || {
207207
let actual = f.get();
208208
assert actual == expected;

src/test/auxiliary/cci_capture_clause.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use core::pipes::*;
1212

1313
pub fn foo<T: Owned Copy>(x: T) -> Port<T> {
1414
let (p, c) = stream();
15-
do task::spawn() |copy x| {
15+
do task::spawn() {
1616
c.send(x);
1717
}
1818
p

src/test/run-pass/capture_nil.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use core::pipes::*;
2828

2929
fn foo(&&x: ()) -> Port<()> {
3030
let (p, c) = stream::<()>();
31-
do task::spawn() |copy x| {
31+
do task::spawn() {
3232
c.send(x);
3333
}
3434
p

src/test/run-pass/issue-3609.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ enum Msg
1212

1313
fn foo(name: ~str, samples_chan: Chan<Msg>) {
1414
do task::spawn
15-
|copy name|
1615
{
1716
let callback: SamplesFn =
1817
|buffer|

0 commit comments

Comments
 (0)