Skip to content

Commit 99b3c07

Browse files
committed
librustc: Get rid of move.
1 parent e61b243 commit 99b3c07

30 files changed

+85
-85
lines changed

src/librustc/back/link.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub mod jit {
156156
code: entry,
157157
env: ptr::null()
158158
};
159-
let func: fn(++argv: ~[~str]) = cast::transmute(move closure);
159+
let func: fn(++argv: ~[~str]) = cast::transmute(closure);
160160

161161
func(~[/*bad*/copy sess.opts.binary]);
162162
}
@@ -559,11 +559,11 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
559559
560560
let {name: opt_name, vers: opt_vers,
561561
cmh_items: cmh_items} = provided_link_metas(sess, c);
562-
let name = crate_meta_name(sess, output, move opt_name);
563-
let vers = crate_meta_vers(sess, move opt_vers);
562+
let name = crate_meta_name(sess, output, opt_name);
563+
let vers = crate_meta_vers(sess, opt_vers);
564564
let dep_hashes = cstore::get_dep_hashes(sess.cstore);
565565
let extras_hash =
566-
crate_meta_extras_hash(symbol_hasher, move cmh_items,
566+
crate_meta_extras_hash(symbol_hasher, cmh_items,
567567
dep_hashes);
568568
569569
return {name: name, vers: vers, extras_hash: extras_hash};

src/librustc/driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub fn time<T>(do_it: bool, what: ~str, thunk: fn() -> T) -> T {
172172
let end = std::time::precise_time_s();
173173
io::stdout().write_str(fmt!("time: %3.3f s\t%s\n",
174174
end - start, what));
175-
move rv
175+
rv
176176
}
177177

178178
pub enum compile_upto {
@@ -257,7 +257,7 @@ pub fn compile_upto(sess: Session, cfg: ast::crate_cfg,
257257
let (llmod, link_meta) = {
258258

259259
let ty_cx = ty::mk_ctxt(sess, def_map, ast_map, freevars,
260-
region_map, rp_set, move lang_items, crate);
260+
region_map, rp_set, lang_items, crate);
261261

262262
let (method_map, vtable_map) =
263263
time(time_passes, ~"typechecking", ||

src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ pub fn struct_element_types(struct_ty: TypeRef) -> ~[TypeRef] {
14811481
llvm::LLVMGetStructElementTypes(
14821482
struct_ty, ptr::to_mut_unsafe_ptr(&mut buf[0]));
14831483
}
1484-
return move buf;
1484+
return buf;
14851485
}
14861486
}
14871487

src/librustc/metadata/decoder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,10 @@ pub fn get_provided_trait_methods(intr: @ident_interner, cdata: cmd,
752752
def_id: did
753753
};
754754

755-
vec::push(&mut result, move provided_trait_method_info);
755+
vec::push(&mut result, provided_trait_method_info);
756756
}
757757

758-
return move result;
758+
return result;
759759
}
760760

761761
/// Returns the supertraits of the given trait.
@@ -766,7 +766,7 @@ pub fn get_supertraits(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
766766
for reader::tagged_docs(item_doc, tag_impl_trait) |trait_doc| {
767767
results.push(doc_type(trait_doc, tcx, cdata));
768768
}
769-
return dvec::unwrap(move results);
769+
return dvec::unwrap(results);
770770
}
771771

772772
// If the item in question is a trait, returns its set of methods and
@@ -847,7 +847,7 @@ pub fn get_static_methods_if_impl(intr: @ident_interner,
847847
}
848848
}
849849

850-
return Some(dvec::unwrap(move static_impl_methods));
850+
return Some(dvec::unwrap(static_impl_methods));
851851
}
852852

853853
pub fn get_item_attrs(cdata: cmd,

src/librustc/metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn get_metadata_section(os: os,
228228
csz - vlen);
229229
do vec::raw::buf_as_slice(cvbuf1, csz-vlen) |bytes| {
230230
let inflated = flate::inflate_bytes(bytes);
231-
found = move Some(@(move inflated));
231+
found = Some(@(inflated));
232232
}
233233
if found != None {
234234
return found;

src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ fn decode_side_tables(xcx: extended_decode_ctxt,
11401140
let ids = val_dsr.read_to_vec(|| {
11411141
xcx.tr_id(val_dsr.read_int())
11421142
});
1143-
let dvec = @dvec::from_vec(move ids);
1143+
let dvec = @dvec::from_vec(ids);
11441144
dcx.maps.last_use_map.insert(id, dvec);
11451145
} else if tag == (c::tag_table_method_map as uint) {
11461146
dcx.maps.method_map.insert(

src/librustc/middle/borrowck/check_loans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ fn check_loans_in_fn(fk: visit::fn_kind,
632632
_ => {} // Ignore this argument.
633633
}
634634
}
635-
*self.fn_args = @move fn_args;
635+
*self.fn_args = @fn_args;
636636
}
637637
}
638638

src/librustc/middle/borrowck/gather_loans.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ impl GatherLoanCtxt {
376376
Some(_) => {
377377
match loan::loan(self.bccx, cmt, scope_r, loan_kind) {
378378
Err(ref e) => { self.bccx.report((*e)); }
379-
Ok(move loans) => {
380-
self.add_loans(cmt, loan_kind, scope_r, move loans);
379+
Ok(loans) => {
380+
self.add_loans(cmt, loan_kind, scope_r, loans);
381381
}
382382
}
383383
}
@@ -540,7 +540,7 @@ impl GatherLoanCtxt {
540540
}
541541
};
542542

543-
self.add_loans_to_scope_id(scope_id, move loans);
543+
self.add_loans_to_scope_id(scope_id, loans);
544544

545545
if loan_kind.is_freeze() && !cmt.mutbl.is_immutable() {
546546
self.bccx.stats.loaned_paths_imm += 1;
@@ -566,7 +566,7 @@ impl GatherLoanCtxt {
566566
req_loans.push_all(loans);
567567
}
568568
None => {
569-
let dvec = @dvec::from_vec(move loans);
569+
let dvec = @dvec::from_vec(loans);
570570
let req_loan_map = self.req_maps.req_loan_map;
571571
req_loan_map.insert(scope_id, dvec);
572572
}

src/librustc/middle/borrowck/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,15 @@ pub fn save_and_restore<T:Copy,U>(save_and_restore_t: &mut T,
420420
let old_save_and_restore_t = *save_and_restore_t;
421421
let u = f();
422422
*save_and_restore_t = old_save_and_restore_t;
423-
move u
423+
u
424424
}
425425

426426
pub fn save_and_restore_managed<T:Copy,U>(save_and_restore_t: @mut T,
427427
f: &fn() -> U) -> U {
428428
let old_save_and_restore_t = *save_and_restore_t;
429429
let u = f();
430430
*save_and_restore_t = old_save_and_restore_t;
431-
move u
431+
u
432432
}
433433

434434
impl LoanKind {

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,7 @@ impl Liveness {
15201520
self.cont_ln.insert(loop_node_id, cont_ln);
15211521
let r = f();
15221522
self.loop_scope.pop();
1523-
move r
1523+
r
15241524
}
15251525
}
15261526

src/librustc/middle/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ pub fn Resolver(session: Session,
797797
intr: session.intr()
798798
};
799799
800-
move self
800+
self
801801
}
802802
803803
/// The main resolver class.
@@ -3255,7 +3255,7 @@ pub impl Resolver {
32553255
self.add_exports_for_module(&mut exports2, module_);
32563256
match copy module_.def_id {
32573257
Some(def_id) => {
3258-
self.export_map2.insert(def_id.node, move exports2);
3258+
self.export_map2.insert(def_id.node, exports2);
32593259
debug!("(computing exports) writing exports for %d (some)",
32603260
def_id.node);
32613261
}

src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ pub fn enter_opt(bcx: block, m: &[@Match/&r], opt: &Opt, col: uint,
559559
Some(fp) => reordered_patterns.push(fp.pat)
560560
}
561561
}
562-
Some(dvec::unwrap(move reordered_patterns))
562+
Some(dvec::unwrap(reordered_patterns))
563563
} else {
564564
None
565565
}
@@ -815,7 +815,7 @@ pub fn get_options(ccx: @crate_ctxt, m: &[@Match], col: uint) -> ~[Opt] {
815815
_ => {}
816816
}
817817
}
818-
return dvec::unwrap(move found);
818+
return dvec::unwrap(found);
819819
}
820820
821821
pub fn extract_variant_args(bcx: block,
@@ -1657,7 +1657,7 @@ pub fn trans_match_inner(scope_cx: block,
16571657
arm_cxs.push(bcx);
16581658
}
16591659
1660-
bcx = controlflow::join_blocks(scope_cx, dvec::unwrap(move arm_cxs));
1660+
bcx = controlflow::join_blocks(scope_cx, dvec::unwrap(arm_cxs));
16611661
return bcx;
16621662
16631663
fn mk_fail(bcx: block, sp: span, +msg: ~str,

src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ pub fn new_block(cx: fn_ctxt, parent: Option<block>, +kind: block_kind,
11741174
});
11751175
let bcx = mk_block(llbb,
11761176
parent,
1177-
move kind,
1177+
kind,
11781178
is_lpad,
11791179
opt_node_info,
11801180
cx);

src/librustc/middle/trans/cabi_x86_64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ fn classify_ty(ty: TypeRef) -> ~[x86_64_reg_class] {
274274
if words > 4 {
275275
all_mem(cls);
276276
let cls = cls;
277-
return move cls;
277+
return cls;
278278
}
279279
classify(ty, cls, 0, 0);
280280
fixup(ty, cls);
281-
return move cls;
281+
return cls;
282282
}
283283
284284
fn llreg_ty(cls: &[x86_64_reg_class]) -> TypeRef {

src/librustc/middle/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ pub fn block_(llbb: BasicBlockRef, parent: Option<block>, -kind: block_kind,
593593
terminated: false,
594594
unreachable: false,
595595
parent: parent,
596-
kind: move kind,
596+
kind: kind,
597597
is_lpad: is_lpad,
598598
node_info: node_info,
599599
fcx: fcx
@@ -607,7 +607,7 @@ pub enum block = @block_;
607607
pub fn mk_block(llbb: BasicBlockRef, parent: Option<block>, -kind: block_kind,
608608
is_lpad: bool, node_info: Option<node_info>, fcx: fn_ctxt)
609609
-> block {
610-
block(@block_(llbb, parent, move kind, is_lpad, node_info, fcx))
610+
block(@block_(llbb, parent, kind, is_lpad, node_info, fcx))
611611
}
612612

613613
// First two args are retptr, env

src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ enum debug_metadata {
152152
fn cast_safely<T: Copy, U>(val: T) -> U {
153153
unsafe {
154154
let val2 = val;
155-
return cast::transmute(move val2);
155+
return cast::transmute(val2);
156156
}
157157
}
158158

src/librustc/middle/ty.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub pure fn get(t: t) -> t_box {
320320
unsafe {
321321
let t2 = cast::reinterpret_cast::<t, t_box>(&t);
322322
let t3 = t2;
323-
cast::forget(move t2);
323+
cast::forget(t2);
324324
t3
325325
}
326326
}
@@ -830,7 +830,7 @@ pub fn mk_ctxt(s: session::Session,
830830
inferred_modes: HashMap(),
831831
adjustments: HashMap(),
832832
normalized_cache: new_ty_hash(),
833-
lang_items: move lang_items,
833+
lang_items: lang_items,
834834
legacy_boxed_traits: HashMap(),
835835
provided_methods: HashMap(),
836836
provided_method_sources: HashMap(),
@@ -909,10 +909,10 @@ fn mk_t_with_id(cx: ctxt, +st: sty, o_def_id: Option<ast::def_id>) -> t {
909909
}
910910
}
911911

912-
let t = @{sty: move st, id: cx.next_id, flags: flags, o_def_id: o_def_id};
912+
let t = @{sty: st, id: cx.next_id, flags: flags, o_def_id: o_def_id};
913913

914914
let key = intern_key {sty: to_unsafe_ptr(&t.sty), o_def_id: o_def_id};
915-
cx.interner.insert(move key, t);
915+
cx.interner.insert(key, t);
916916

917917
cx.next_id += 1u;
918918
unsafe { cast::reinterpret_cast(&t) }
@@ -1178,7 +1178,7 @@ pub fn fold_sig(sig: &FnSig, fldop: fn(t) -> t) -> FnSig {
11781178
};
11791179

11801180
FnSig {
1181-
inputs: move args,
1181+
inputs: args,
11821182
output: fldop(sig.output)
11831183
}
11841184
}
@@ -3110,7 +3110,7 @@ pub fn expr_kind(tcx: ctxt,
31103110
ast::def_local(*) |
31113111
ast::def_self(*) => LvalueExpr,
31123112

3113-
move def => {
3113+
def => {
31143114
tcx.sess.span_bug(expr.span, fmt!(
31153115
"Uncategorized def for expr %?: %?",
31163116
expr.id, def));
@@ -3617,7 +3617,7 @@ pub fn trait_supertraits(cx: ctxt,
36173617
}
36183618

36193619
// Unwrap and return the result.
3620-
return @dvec::unwrap(move result);
3620+
return @dvec::unwrap(result);
36213621
}
36223622

36233623
pub fn trait_methods(cx: ctxt, id: ast::def_id) -> @~[method] {

0 commit comments

Comments
 (0)