Skip to content

Commit 78f3e0d

Browse files
committed
librustdoc: Get rid of move.
1 parent 4b7d27c commit 78f3e0d

File tree

11 files changed

+46
-46
lines changed

11 files changed

+46
-46
lines changed

src/librustdoc/astsrv.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn run<T>(owner: SrvOwner<T>, source: ~str, parse: Parser) -> T {
9191

9292
let res = owner(srv_.clone());
9393
srv_.ch.send(Exit);
94-
move res
94+
res
9595
}
9696

9797
fn act(po: &Port<Msg>, source: ~str, parse: Parser) {
@@ -120,10 +120,10 @@ pub fn exec<T:Owned>(
120120
f: fn~(ctxt: Ctxt) -> T
121121
) -> T {
122122
let (po, ch) = stream();
123-
let msg = HandleRequest(fn~(move f, ctxt: Ctxt) {
123+
let msg = HandleRequest(fn~(ctxt: Ctxt) {
124124
ch.send(f(ctxt))
125125
});
126-
srv.ch.send(move msg);
126+
srv.ch.send(msg);
127127
po.recv()
128128
}
129129

src/librustdoc/attr_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn parse_item_attrs<T:Owned>(
115115
srv: astsrv::Srv,
116116
id: doc::AstId,
117117
parse_attrs: fn~(a: ~[ast::attribute]) -> T) -> T {
118-
do astsrv::exec(srv) |move parse_attrs, ctxt| {
118+
do astsrv::exec(srv) |ctxt| {
119119
let attrs = match ctxt.ast_map.get(&id) {
120120
ast_map::node_item(item, _) => copy item.attrs,
121121
ast_map::node_foreign_item(item, _, _) => copy item.attrs,

src/librustdoc/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn parse_config_(
133133
result::Ok(matches) => {
134134
if matches.free.len() == 1 {
135135
let input_crate = Path(vec::head(matches.free));
136-
config_from_opts(&input_crate, &matches, move program_output)
136+
config_from_opts(&input_crate, &matches, program_output)
137137
} else if matches.free.is_empty() {
138138
result::Err(~"no crates specified")
139139
} else {
@@ -191,11 +191,11 @@ fn config_from_opts(
191191
}
192192
}
193193
};
194-
let program_output = Cell(move program_output);
194+
let program_output = Cell(program_output);
195195
let result = do result::chain(result) |config| {
196196
let pandoc_cmd = getopts::opt_maybe_str(matches, opt_pandoc_cmd());
197197
let pandoc_cmd = maybe_find_pandoc(
198-
&config, pandoc_cmd, move program_output.take());
198+
&config, pandoc_cmd, program_output.take());
199199
do result::chain(pandoc_cmd) |pandoc_cmd| {
200200
result::Ok(Config {
201201
pandoc_cmd: pandoc_cmd,
@@ -268,7 +268,7 @@ fn should_find_pandoc() {
268268
status: 0, out: ~"pandoc 1.8.2.1", err: ~""
269269
}
270270
};
271-
let result = maybe_find_pandoc(&config, None, move mock_program_output);
271+
let result = maybe_find_pandoc(&config, None, mock_program_output);
272272
assert result == result::Ok(Some(~"pandoc"));
273273
}
274274

@@ -284,7 +284,7 @@ fn should_error_with_no_pandoc() {
284284
status: 1, out: ~"", err: ~""
285285
}
286286
};
287-
let result = maybe_find_pandoc(&config, None, move mock_program_output);
287+
let result = maybe_find_pandoc(&config, None, mock_program_output);
288288
assert result == result::Err(~"couldn't find pandoc");
289289
}
290290

src/librustdoc/fold.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,25 @@ fn mk_fold<T>(
8787
fold_struct: FoldStruct<T>
8888
) -> Fold<T> {
8989
Fold {
90-
ctxt: move ctxt,
91-
fold_doc: move fold_doc,
92-
fold_crate: move fold_crate,
93-
fold_item: move fold_item,
94-
fold_mod: move fold_mod,
95-
fold_nmod: move fold_nmod,
96-
fold_fn: move fold_fn,
97-
fold_const: move fold_const,
98-
fold_enum: move fold_enum,
99-
fold_trait: move fold_trait,
100-
fold_impl: move fold_impl,
101-
fold_type: move fold_type,
102-
fold_struct: move fold_struct
90+
ctxt: ctxt,
91+
fold_doc: fold_doc,
92+
fold_crate: fold_crate,
93+
fold_item: fold_item,
94+
fold_mod: fold_mod,
95+
fold_nmod: fold_nmod,
96+
fold_fn: fold_fn,
97+
fold_const: fold_const,
98+
fold_enum: fold_enum,
99+
fold_trait: fold_trait,
100+
fold_impl: fold_impl,
101+
fold_type: fold_type,
102+
fold_struct: fold_struct
103103
}
104104
}
105105

106106
pub fn default_any_fold<T: Clone>(ctxt: T) -> Fold<T> {
107107
mk_fold(
108-
move ctxt,
108+
ctxt,
109109
|f, d| default_seq_fold_doc(f, d),
110110
|f, d| default_seq_fold_crate(f, d),
111111
|f, d| default_seq_fold_item(f, d),
@@ -123,7 +123,7 @@ pub fn default_any_fold<T: Clone>(ctxt: T) -> Fold<T> {
123123

124124
pub fn default_seq_fold<T: Clone>(ctxt: T) -> Fold<T> {
125125
mk_fold(
126-
move ctxt,
126+
ctxt,
127127
|f, d| default_seq_fold_doc(f, d),
128128
|f, d| default_seq_fold_crate(f, d),
129129
|f, d| default_seq_fold_item(f, d),
@@ -141,7 +141,7 @@ pub fn default_seq_fold<T: Clone>(ctxt: T) -> Fold<T> {
141141

142142
pub fn default_par_fold<T: Clone>(ctxt: T) -> Fold<T> {
143143
mk_fold(
144-
move ctxt,
144+
ctxt,
145145
|f, d| default_seq_fold_doc(f, d),
146146
|f, d| default_seq_fold_crate(f, d),
147147
|f, d| default_seq_fold_item(f, d),

src/librustdoc/markdown_pass.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn run(
7474
~"mods last", mods_last
7575
).f)(srv, copy doc);
7676

77-
write_markdown(sorted_doc, move writer_factory);
77+
write_markdown(sorted_doc, writer_factory);
7878

7979
return doc;
8080
}
@@ -148,7 +148,7 @@ fn should_request_new_writer_for_each_page() {
148148
let (srv, doc) = test::create_doc_srv(~"mod a { }");
149149
// Split the document up into pages
150150
let doc = (page_pass::mk_pass(config::DocPerMod).f)(srv, doc);
151-
write_markdown(doc, move writer_factory);
151+
write_markdown(doc, writer_factory);
152152
// We expect two pages to have been written
153153
for iter::repeat(2) {
154154
po.recv();
@@ -180,7 +180,7 @@ fn should_write_title_for_each_page() {
180180
let (srv, doc) = test::create_doc_srv(
181181
~"#[link(name = \"core\")]; mod a { }");
182182
let doc = (page_pass::mk_pass(config::DocPerMod).f)(srv, doc);
183-
write_markdown(doc, move writer_factory);
183+
write_markdown(doc, writer_factory);
184184
for iter::repeat(2) {
185185
let (page, markdown) = po.recv();
186186
match page {
@@ -894,7 +894,7 @@ mod test {
894894
doc: doc::Doc
895895
) -> ~str {
896896
let (writer_factory, po) = markdown_writer::future_writer_factory();
897-
write_markdown(doc, move writer_factory);
897+
write_markdown(doc, writer_factory);
898898
return po.recv().second();
899899
}
900900

@@ -903,7 +903,7 @@ mod test {
903903
doc: doc::Doc
904904
) -> ~str {
905905
let (writer_factory, po) = markdown_writer::future_writer_factory();
906-
let pass = mk_pass(move writer_factory);
906+
let pass = mk_pass(writer_factory);
907907
(pass.f)(srv, doc);
908908
return po.recv().second();
909909
}

src/librustdoc/markdown_writer.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ fn pandoc_writer(
129129
os::close(pipe_in.out);
130130
131131
let (stdout_po, stdout_ch) = pipes::stream();
132-
do task::spawn_sched(task::SingleThreaded) |move stdout_ch| {
132+
do task::spawn_sched(task::SingleThreaded) || {
133133
stdout_ch.send(readclose(pipe_out.in));
134134
}
135135
136136
let (stderr_po, stderr_ch) = pipes::stream();
137-
do task::spawn_sched(task::SingleThreaded) |move stderr_ch| {
137+
do task::spawn_sched(task::SingleThreaded) || {
138138
stderr_ch.send(readclose(pipe_err.in));
139139
}
140140
let stdout = stdout_po.recv();
@@ -169,7 +169,7 @@ fn readclose(fd: libc::c_int) -> ~str {
169169
170170
fn generic_writer(process: fn~(markdown: ~str)) -> Writer {
171171
let (po, ch) = stream::<WriteInstr>();
172-
do task::spawn |move process, move setup_ch| {
172+
do task::spawn || {
173173
let mut markdown = ~"";
174174
let mut keep_going = true;
175175
while keep_going {
@@ -178,7 +178,7 @@ fn generic_writer(process: fn~(markdown: ~str)) -> Writer {
178178
Done => keep_going = false
179179
}
180180
}
181-
process(move markdown);
181+
process(markdown);
182182
};
183183
fn~(instr: WriteInstr) {
184184
ch.send(instr);
@@ -298,24 +298,24 @@ pub fn future_writer_factory(
298298
let writer_factory = fn~(page: doc::Page) -> Writer {
299299
let (writer_po, writer_ch) = pipes::stream();
300300
let markdown_ch = markdown_ch.clone();
301-
do task::spawn |move writer_ch| {
301+
do task::spawn || {
302302
let (writer, future) = future_writer();
303-
writer_ch.send(move writer);
303+
writer_ch.send(writer);
304304
let s = future.get();
305305
markdown_ch.send((copy page, s));
306306
}
307307
writer_po.recv()
308308
};
309309
310-
(move writer_factory, markdown_po)
310+
(writer_factory, markdown_po)
311311
}
312312
313313
fn future_writer() -> (Writer, future::Future<~str>) {
314314
let (port, chan) = pipes::stream();
315-
let writer = fn~(move chan, instr: WriteInstr) {
315+
let writer = fn~(instr: WriteInstr) {
316316
chan.send(copy instr);
317317
};
318-
let future = do future::from_fn |move port| {
318+
let future = do future::from_fn || {
319319
let mut res = ~"";
320320
loop {
321321
match port.recv() {
@@ -325,5 +325,5 @@ fn future_writer() -> (Writer, future::Future<~str>) {
325325
}
326326
res
327327
};
328-
(move writer, move future)
328+
(writer, future)
329329
}

src/librustdoc/page_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn make_doc_from_pages(page_port: &PagePort) -> doc::Doc {
7171
loop {
7272
let val = page_port.recv();
7373
if val.is_some() {
74-
pages += ~[option::unwrap(move val)];
74+
pages += ~[option::unwrap(val)];
7575
} else {
7676
break;
7777
}

src/librustdoc/path_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn run(srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {
5454
fold_item: fold_item,
5555
fold_mod: fold_mod,
5656
fold_nmod: fold_nmod,
57-
.. fold::default_any_fold(move ctxt)
57+
.. fold::default_any_fold(ctxt)
5858
};
5959
(fold.fold_doc)(&fold, doc)
6060
}

src/librustdoc/rustdoc.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,5 @@ fn time<T>(what: ~str, f: fn() -> T) -> T {
149149
let rv = f();
150150
let end = std::time::precise_time_s();
151151
info!("time: %3.3f s %s", end - start, what);
152-
move rv
152+
rv
153153
}

src/librustdoc/sort_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn run(
4242
) -> doc::Doc {
4343
let fold = Fold {
4444
fold_mod: fold_mod,
45-
.. fold::default_any_fold(move lteq)
45+
.. fold::default_any_fold(lteq)
4646
};
4747
(fold.fold_doc)(&fold, doc)
4848
}

src/librustdoc/text_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ fn run(
4242
op: Op
4343
) -> doc::Doc {
4444
let op = NominalOp {
45-
op: move op
45+
op: op
4646
};
4747
let fold = Fold {
4848
fold_item: fold_item,
4949
fold_enum: fold_enum,
5050
fold_trait: fold_trait,
5151
fold_impl: fold_impl,
52-
.. fold::default_any_fold(move op)
52+
.. fold::default_any_fold(op)
5353
};
5454
(fold.fold_doc)(&fold, doc)
5555
}

0 commit comments

Comments
 (0)