diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index dd332fd8633..cd22b2c5c04 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -181,7 +181,7 @@ mod ct { let rest = copy next.flags; let j = next.next; let curr: ~[flag] = ~[f]; - return {flags: vec::append(curr, rest), next: j}; + return {flags: vec::append(move curr, rest), next: j}; } let more = |x, copy s| more_(x, copy s, i, lim); let f = s[i]; @@ -195,7 +195,7 @@ mod ct { more(flag_sign_always) } else if f == '#' as u8 { more(flag_alternate) - } else { {flags: noflags, next: i} }; + } else { {flags: move noflags, next: i} }; } fn parse_count(s: ~str, i: uint, lim: uint) -> {count: count, next: uint} { diff --git a/src/libcore/mutable.rs b/src/libcore/mutable.rs index eca9ff6fada..354bb686fef 100644 --- a/src/libcore/mutable.rs +++ b/src/libcore/mutable.rs @@ -34,7 +34,7 @@ fn unwrap(+m: Mut) -> T { // Borrowck should prevent us from calling unwrap while the value // is in use, as that would be a move from a borrowed value. assert (m.mode as uint) == (ReadOnly as uint); - let Data {value, mode: _} = m; + let Data {value, mode: _} <- m; return move value; } diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 34ddee55a63..b9fed4b46aa 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -2,15 +2,15 @@ use codemap::span; use ast::*; pure fn spanned(lo: uint, hi: uint, +t: T) -> spanned { - respan(mk_sp(lo, hi), t) + respan(mk_sp(lo, hi), move t) } pure fn respan(sp: span, +t: T) -> spanned { - {node: t, span: sp} + {node: move t, span: sp} } pure fn dummy_spanned(+t: T) -> spanned { - respan(dummy_sp(), t) + respan(dummy_sp(), move t) } /* assuming that we're not in macro expansion */ diff --git a/src/libsyntax/attr.rs b/src/libsyntax/attr.rs index 67a7b6d3101..d6a08fe1aa4 100644 --- a/src/libsyntax/attr.rs +++ b/src/libsyntax/attr.rs @@ -282,7 +282,7 @@ fn sort_meta_items(+items: ~[@ast::meta_item]) -> ~[@ast::meta_item] { // This is sort of stupid here, converting to a vec of mutables and back let v: ~[mut @ast::meta_item] = vec::to_mut(items); std::sort::quick_sort(lteq, v); - return vec::from_mut(v); + vec::from_mut(move v) } fn remove_meta_items_by_name(items: ~[@ast::meta_item], name: ~str) -> diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs index e1114ce8e2a..6de6be82ae2 100644 --- a/src/libsyntax/ext/base.rs +++ b/src/libsyntax/ext/base.rs @@ -222,14 +222,14 @@ fn mk_ctxt(parse_sess: parse::parse_sess, self.parse_sess.interner.intern(@st) } } - let imp : ctxt_repr = { + let imp: ctxt_repr = { parse_sess: parse_sess, cfg: cfg, mut backtrace: None, mut mod_path: ~[], mut trace_mac: false }; - return imp as ext_ctxt + move (imp as ext_ctxt) } fn expr_to_str(cx: ext_ctxt, expr: @ast::expr, error: ~str) -> ~str { diff --git a/src/libsyntax/ext/pipes/liveness.rs b/src/libsyntax/ext/pipes/liveness.rs index fa0ab0f4c0b..8b17ffc1104 100644 --- a/src/libsyntax/ext/pipes/liveness.rs +++ b/src/libsyntax/ext/pipes/liveness.rs @@ -39,7 +39,7 @@ fn analyze(proto: protocol, _cx: ext_ctxt) { for state.reachable |s| { bv.set(s.id, true); } - bv + move bv }; let mut i = 0; diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 1f674bb5395..373f16daeb0 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -188,7 +188,7 @@ impl protocol { span: self.span, dir: dir, ty_params: ty_params, - messages: messages, + messages: move messages, proto: self }); diff --git a/src/libsyntax/ext/simplext.rs b/src/libsyntax/ext/simplext.rs index 56fbb3bb074..08fa427d078 100644 --- a/src/libsyntax/ext/simplext.rs +++ b/src/libsyntax/ext/simplext.rs @@ -143,7 +143,7 @@ fn pattern_to_selectors(cx: ext_ctxt, e: @expr) -> binders { return Some(leaf(m)); } p_t_s_rec(cx, match_expr(e), trivial_selector, res); - return res; + move res } diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index f32c23c936f..799457381d5 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -255,8 +255,8 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) sp.hi))); } - new_pos.idx += 1u; - vec::push(cur_eis, new_pos); + new_pos.idx += 1; + vec::push(cur_eis, move new_pos); } // can we go around again? @@ -266,18 +266,18 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) Some(t) if idx == len => { // we need a separator if tok == t { //pass the separator let ei_t <- ei; - ei_t.idx += 1u; - vec::push(next_eis, ei_t); + ei_t.idx += 1; + vec::push(next_eis, move ei_t); } } _ => { // we don't need a separator let ei_t <- ei; - ei_t.idx = 0u; - vec::push(cur_eis, ei_t); + ei_t.idx = 0; + vec::push(cur_eis, move ei_t); } } } else { - vec::push(eof_eis, ei); + vec::push(eof_eis, move ei); } } else { match copy ei.elts[idx].node { @@ -292,7 +292,7 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) new_ei.matches[idx].push(@matched_seq(~[], sp)); } - vec::push(cur_eis, new_ei); + vec::push(cur_eis, move new_ei); } let matches = vec::map(ei.matches, // fresh, same size: @@ -300,16 +300,19 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) let ei_t <- ei; vec::push(cur_eis, ~{ elts: matchers, sep: sep, mut idx: 0u, - mut up: matcher_pos_up(Some(ei_t)), - matches: matches, + mut up: matcher_pos_up(Some(move ei_t)), + matches: move matches, match_lo: match_idx_lo, match_hi: match_idx_hi, sp_lo: sp.lo }); } - match_nonterminal(_,_,_) => { vec::push(bb_eis, ei) } + match_nonterminal(_,_,_) => { vec::push(bb_eis, move ei) } match_tok(t) => { let ei_t <- ei; - if t == tok { ei_t.idx += 1u; vec::push(next_eis, ei_t)} + if t == tok { + ei_t.idx += 1; + vec::push(next_eis, move ei_t); + } } } } @@ -362,7 +365,7 @@ fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher]) } _ => fail } - vec::push(cur_eis,ei); + vec::push(cur_eis, move ei); /* this would fail if zero-length tokens existed */ while rdr.peek().sp.lo < rust_parser.span.lo { diff --git a/src/libsyntax/parse.rs b/src/libsyntax/parse.rs index 5d2e081354e..367be53a190 100644 --- a/src/libsyntax/parse.rs +++ b/src/libsyntax/parse.rs @@ -157,7 +157,7 @@ fn parse_from_source_str(f: fn (p: parser) -> T, p.abort_if_errors(); sess.chpos = rdr.chpos; sess.byte_pos = sess.byte_pos + rdr.pos; - return r; + move r } fn next_node_id(sess: parse_sess) -> node_id { @@ -184,7 +184,7 @@ fn new_parser_from_source_str(sess: parse_sess, cfg: ast::crate_cfg, +name: ~str, +ss: codemap::file_substr, source: @~str) -> parser { let (p, _) = new_parser_etc_from_source_str(sess, cfg, name, ss, source); - return p; + move p } @@ -208,7 +208,7 @@ fn new_parser_etc_from_file(sess: parse_sess, cfg: ast::crate_cfg, fn new_parser_from_file(sess: parse_sess, cfg: ast::crate_cfg, path: &Path, ftype: parser::file_type) -> parser { let (p, _) = new_parser_etc_from_file(sess, cfg, path, ftype); - return p; + move p } fn new_parser_from_tt(sess: parse_sess, cfg: ast::crate_cfg, diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 49fa14c5b7d..6cec730d83d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3578,8 +3578,8 @@ impl parser { } {attrs_remaining: attrs, - view_items: vec::from_mut(dvec::unwrap(view_items)), - items: vec::from_mut(dvec::unwrap(items))} + view_items: vec::from_mut(dvec::unwrap(move view_items)), + items: vec::from_mut(dvec::unwrap(move items))} } // Parses a source module as a crate diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 71eabb410bb..6ab936f1448 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -124,7 +124,7 @@ const size_infinity: int = 0xffff; fn mk_printer(out: io::Writer, linewidth: uint) -> printer { // Yes 3, it makes the ring buffers big enough to never // fall behind. - let n: uint = 3u * linewidth; + let n: uint = 3 * linewidth; debug!("mk_printer %u", linewidth); let token: ~[mut token] = vec::to_mut(vec::from_elem(n, EOF)); let size: ~[mut int] = vec::to_mut(vec::from_elem(n, 0)); @@ -133,16 +133,16 @@ fn mk_printer(out: io::Writer, linewidth: uint) -> printer { buf_len: n, mut margin: linewidth as int, mut space: linewidth as int, - mut left: 0u, - mut right: 0u, - token: token, - size: size, + mut left: 0, + mut right: 0, + token: move token, + size: move size, mut left_total: 0, mut right_total: 0, - mut scan_stack: scan_stack, + mut scan_stack: move scan_stack, mut scan_stack_empty: true, - mut top: 0u, - mut bottom: 0u, + mut top: 0, + mut bottom: 0, print_stack: DVec(), mut pending_indentation: 0, mut token_tree_last_was_ident: false}) diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 7e42919f724..1a832bf5af0 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -16,7 +16,7 @@ fn mk() -> interner { let m = map::HashMap::(); let hi: hash_interner = {map: m, vect: DVec()}; - return hi as interner::; + move (hi as interner::) } fn mk_prefill(init: ~[T]) -> interner {