Skip to content

Commit 7a80ea7

Browse files
committed
---
yaml --- r: 10729 b: refs/heads/snap-stage3 c: b9d3ad0 h: refs/heads/master i: 10727: 77a67e5 v: v3
1 parent aa611ba commit 7a80ea7

35 files changed

+262
-249
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 007b9d9acd8b04ad2e1984aeba79c2031dec0e45
4+
refs/heads/snap-stage3: b9d3ad0736dfc3a69f50155d2251f195de54b6c6
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/src/libcore/dvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl extensions<A:copy> for dvec<A> {
218218
}
219219
};
220220

221-
for ts.each { |t| v += [t]/~ };
221+
for ts.each { |t| vec::push(v, t) };
222222
v
223223
}
224224
}

branches/snap-stage3/src/libcore/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export rsplit;
3131
export rsplitn;
3232
export shift;
3333
export pop;
34-
export push;
34+
export push, push_all;
3535
export grow;
3636
export grow_fn;
3737
export grow_set;

branches/snap-stage3/src/libsyntax/ast_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ fn map_item(i: @item, cx: ctx, v: vt) {
229229
}
230230
alt i.node {
231231
item_mod(_) | item_native_mod(_) {
232-
cx.path += [path_mod(i.ident)]/~;
232+
vec::push(cx.path, path_mod(i.ident));
233233
}
234-
_ { cx.path += [path_name(i.ident)]/~; }
234+
_ { vec::push(cx.path, path_name(i.ident)); }
235235
}
236236
visit::visit_item(i, cx, v);
237237
vec::pop(cx.path);

branches/snap-stage3/src/libsyntax/ast_util.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,13 @@ fn split_class_items(cs: [@class_member]/~) -> ([ivar]/~, [@method]/~) {
298298
for cs.each {|c|
299299
alt c.node {
300300
instance_var(i, t, cm, id, vis) {
301-
vs += [{ident: /* FIXME (#2543) */ copy i,
302-
ty: t,
303-
cm: cm,
304-
id: id,
305-
vis: vis}]/~;
301+
vec::push(vs, {ident: /* FIXME (#2543) */ copy i,
302+
ty: t,
303+
cm: cm,
304+
id: id,
305+
vis: vis});
306306
}
307-
class_method(m) { ms += [m]/~; }
307+
class_method(m) { vec::push(ms, m); }
308308
}
309309
};
310310
(vs, ms)

branches/snap-stage3/src/libsyntax/codemap.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn mk_substr_filename(cm: codemap, sp: span) -> str
7474
}
7575

7676
fn next_line(file: filemap, chpos: uint, byte_pos: uint) {
77-
file.lines += [{ch: chpos, byte: byte_pos + file.start_pos.byte}]/~;
77+
vec::push(file.lines, {ch: chpos, byte: byte_pos + file.start_pos.byte});
7878
}
7979

8080
type lookup_fn = pure fn(file_pos) -> uint;
@@ -185,7 +185,9 @@ fn span_to_lines(sp: span, cm: codemap::codemap) -> @file_lines {
185185
let lo = lookup_char_pos(cm, sp.lo);
186186
let hi = lookup_char_pos(cm, sp.hi);
187187
let mut lines = []/~;
188-
for uint::range(lo.line - 1u, hi.line as uint) {|i| lines += [i]/~; };
188+
for uint::range(lo.line - 1u, hi.line as uint) {|i|
189+
vec::push(lines, i);
190+
};
189191
ret @{file: lo.file, lines: lines};
190192
}
191193

branches/snap-stage3/src/libsyntax/parse/comments.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn consume_non_eol_whitespace(rdr: string_reader) {
4444
fn push_blank_line_comment(rdr: string_reader, &comments: [cmnt]/~) {
4545
#debug(">>> blank-line comment");
4646
let v: [str]/~ = []/~;
47-
comments += [{style: blank_line, lines: v, pos: rdr.chpos}]/~;
47+
vec::push(comments, {style: blank_line, lines: v, pos: rdr.chpos});
4848
}
4949

5050
fn consume_whitespace_counting_blank_lines(rdr: string_reader,
@@ -73,7 +73,7 @@ fn read_line_comments(rdr: string_reader, code_to_the_left: bool) -> cmnt {
7373
while rdr.curr == '/' && nextch(rdr) == '/' {
7474
let line = read_one_line_comment(rdr);
7575
log(debug, line);
76-
lines += [line]/~;
76+
vec::push(lines, line);
7777
consume_non_eol_whitespace(rdr);
7878
}
7979
#debug("<<< line comments");
@@ -98,7 +98,7 @@ fn trim_whitespace_prefix_and_push_line(&lines: [str]/~,
9898
} else { s1 = ""; }
9999
} else { s1 = s; }
100100
log(debug, "pushing line: " + s1);
101-
lines += [s1]/~;
101+
vec::push(lines, s1);
102102
}
103103

104104
fn read_block_comment(rdr: string_reader, code_to_the_left: bool) -> cmnt {
@@ -156,11 +156,11 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool,
156156
&comments: [cmnt]/~) {
157157
#debug(">>> consume comment");
158158
if rdr.curr == '/' && nextch(rdr) == '/' {
159-
comments += [read_line_comments(rdr, code_to_the_left)]/~;
159+
vec::push(comments, read_line_comments(rdr, code_to_the_left));
160160
} else if rdr.curr == '/' && nextch(rdr) == '*' {
161-
comments += [read_block_comment(rdr, code_to_the_left)]/~;
161+
vec::push(comments, read_block_comment(rdr, code_to_the_left));
162162
} else if rdr.curr == '#' && nextch(rdr) == '!' {
163-
comments += [read_shebang_comment(rdr, code_to_the_left)]/~;
163+
vec::push(comments, read_shebang_comment(rdr, code_to_the_left));
164164
} else { fail; }
165165
#debug("<<< consume comment");
166166
}

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class parser {
277277
let mut constrs: [@constr_general<T>]/~ = []/~;
278278
loop {
279279
let constr = pser(self);
280-
constrs += [constr]/~;
280+
vec::push(constrs, constr);
281281
if self.token == token::COMMA { self.bump(); }
282282
else { ret constrs; }
283283
};
@@ -363,7 +363,7 @@ class parser {
363363
let mut ts = [self.parse_ty(false)]/~;
364364
while self.token == token::COMMA {
365365
self.bump();
366-
ts += [self.parse_ty(false)]/~;
366+
vec::push(ts, self.parse_ty(false));
367367
}
368368
let t = if vec::len(ts) == 1u { ts[0].node }
369369
else { ty_tup(ts) };
@@ -591,10 +591,10 @@ class parser {
591591
&& self.look_ahead(1u) == token::MOD_SEP;
592592

593593
if is_not_last {
594-
ids += [parse_ident(self)]/~;
594+
vec::push(ids, parse_ident(self));
595595
self.expect(token::MOD_SEP);
596596
} else {
597-
ids += [parse_last_ident(self)]/~;
597+
vec::push(ids, parse_last_ident(self));
598598
break;
599599
}
600600
}
@@ -718,7 +718,7 @@ class parser {
718718
}
719719
let mut es = [self.parse_expr()]/~;
720720
while self.token == token::COMMA {
721-
self.bump(); es += [self.parse_expr()]/~;
721+
self.bump(); vec::push(es, self.parse_expr());
722722
}
723723
hi = self.span.hi;
724724
self.expect(token::RPAREN);
@@ -751,7 +751,7 @@ class parser {
751751
// record ends by an optional trailing comma
752752
break;
753753
}
754-
fields += [self.parse_field(token::COLON)]/~;
754+
vec::push(fields, self.parse_field(token::COLON));
755755
}
756756
hi = self.span.hi;
757757
self.expect(token::RBRACE);
@@ -1393,7 +1393,7 @@ class parser {
13931393
if self.eat_keyword("if") { guard = some(self.parse_expr()); }
13941394
if self.token == token::FAT_ARROW { self.bump(); }
13951395
let blk = self.parse_block();
1396-
arms += [{pats: pats, guard: guard, body: blk}]/~;
1396+
vec::push(arms, {pats: pats, guard: guard, body: blk});
13971397
}
13981398
let mut hi = self.span.hi;
13991399
self.bump();
@@ -1438,7 +1438,7 @@ class parser {
14381438
fn parse_pats() -> [@pat]/~ {
14391439
let mut pats = []/~;
14401440
loop {
1441-
pats += [self.parse_pat()]/~;
1441+
vec::push(pats, self.parse_pat());
14421442
if self.token == token::BINOP(token::OR) { self.bump(); }
14431443
else { ret pats; }
14441444
};
@@ -1499,7 +1499,7 @@ class parser {
14991499
node: pat_ident(fieldpath, none),
15001500
span: mk_sp(lo, hi)};
15011501
}
1502-
fields += [{ident: fieldname, pat: subpat}]/~;
1502+
vec::push(fields, {ident: fieldname, pat: subpat});
15031503
}
15041504
hi = self.span.hi;
15051505
self.bump();
@@ -1517,7 +1517,7 @@ class parser {
15171517
let mut fields = [self.parse_pat()]/~;
15181518
while self.token == token::COMMA {
15191519
self.bump();
1520-
fields += [self.parse_pat()]/~;
1520+
vec::push(fields, self.parse_pat());
15211521
}
15221522
if vec::len(fields) == 1u { self.expect(token::COMMA); }
15231523
hi = self.span.hi;
@@ -1607,7 +1607,7 @@ class parser {
16071607
let lo = self.span.lo;
16081608
let mut locals = [self.parse_local(is_mutbl, true)]/~;
16091609
while self.eat(token::COMMA) {
1610-
locals += [self.parse_local(is_mutbl, true)]/~;
1610+
vec::push(locals, self.parse_local(is_mutbl, true));
16111611
}
16121612
ret @spanned(lo, self.last_span.hi, decl_local(locals));
16131613
}
@@ -1769,13 +1769,13 @@ class parser {
17691769
but found '"
17701770
+ token_to_str(self.reader, t) + "'");
17711771
}
1772-
stmts += [stmt]/~;
1772+
vec::push(stmts, stmt);
17731773
}
17741774
}
17751775
}
17761776

17771777
_ { // All other kinds of statements:
1778-
stmts += [stmt]/~;
1778+
vec::push(stmts, stmt);
17791779

17801780
if classify::stmt_ends_with_semi(*stmt) {
17811781
self.expect(token::SEMI);
@@ -1964,7 +1964,7 @@ class parser {
19641964
let mut meths = []/~;
19651965
self.expect(token::LBRACE);
19661966
while !self.eat(token::RBRACE) {
1967-
meths += [self.parse_method(public)]/~;
1967+
vec::push(meths, self.parse_method(public));
19681968
}
19691969
(ident, item_impl(tps, rp, ifce, ty, meths), none)
19701970
}
@@ -2099,7 +2099,7 @@ class parser {
20992099
self.expect(token::LBRACE);
21002100
let mut results = []/~;
21012101
while self.token != token::RBRACE {
2102-
results += [self.parse_single_class_item(private)]/~;
2102+
vec::push(results, self.parse_single_class_item(private));
21032103
}
21042104
self.bump();
21052105
ret members(results);
@@ -2129,7 +2129,7 @@ class parser {
21292129
#debug["parse_mod_items: parse_item(attrs=%?)", attrs];
21302130
let vis = self.parse_visibility(private);
21312131
alt self.parse_item(attrs, vis) {
2132-
some(i) { items += [i]/~; }
2132+
some(i) { vec::push(items, i); }
21332133
_ {
21342134
self.fatal("expected item but found '" +
21352135
token_to_str(self.reader, self.token) + "'");
@@ -2206,7 +2206,7 @@ class parser {
22062206
while self.token != token::RBRACE {
22072207
let attrs = initial_attrs + self.parse_outer_attributes();
22082208
initial_attrs = []/~;
2209-
items += [self.parse_native_item(attrs)]/~;
2209+
vec::push(items, self.parse_native_item(attrs));
22102210
}
22112211
ret {view_items: view_items,
22122212
items: items};
@@ -2285,7 +2285,7 @@ class parser {
22852285
seq_sep_trailing_disallowed(token::COMMA),
22862286
{|p| p.parse_ty(false)});
22872287
for arg_tys.each {|ty|
2288-
args += [{ty: ty, id: self.get_id()}]/~;
2288+
vec::push(args, {ty: ty, id: self.get_id()});
22892289
}
22902290
} else if self.eat(token::EQ) {
22912291
have_disr = true;
@@ -2295,7 +2295,7 @@ class parser {
22952295
let vr = {name: ident, attrs: variant_attrs,
22962296
args: args, id: self.get_id(),
22972297
disr_expr: disr_expr, vis: vis};
2298-
variants += [spanned(vlo, self.last_span.hi, vr)]/~;
2298+
vec::push(variants, spanned(vlo, self.last_span.hi, vr));
22992299

23002300
if !self.eat(token::COMMA) { break; }
23012301
}
@@ -2399,7 +2399,7 @@ class parser {
23992399
while self.token == token::MOD_SEP {
24002400
self.bump();
24012401
let id = self.parse_ident();
2402-
path += [id]/~;
2402+
vec::push(path, id);
24032403
}
24042404
let path = @{span: mk_sp(lo, self.span.hi), global: false,
24052405
idents: path, rp: none, types: []/~};
@@ -2416,7 +2416,7 @@ class parser {
24162416

24172417
token::IDENT(i, _) {
24182418
self.bump();
2419-
path += [self.get_str(i)]/~;
2419+
vec::push(path, self.get_str(i));
24202420
}
24212421

24222422
// foo::bar::{a,b,c}
@@ -2459,7 +2459,7 @@ class parser {
24592459
let mut vp = [self.parse_view_path()]/~;
24602460
while self.token == token::COMMA {
24612461
self.bump();
2462-
vp += [self.parse_view_path()]/~;
2462+
vec::push(vp, self.parse_view_path());
24632463
}
24642464
ret vp;
24652465
}
@@ -2494,7 +2494,7 @@ class parser {
24942494
let mut items = []/~;
24952495
while if only_imports { self.is_keyword("import") }
24962496
else { self.is_view_item() } {
2497-
items += [self.parse_view_item(attrs)]/~;
2497+
vec::push(items, self.parse_view_item(attrs));
24982498
attrs = self.parse_outer_attributes();
24992499
}
25002500
{attrs_remaining: attrs, view_items: items}
@@ -2583,7 +2583,7 @@ class parser {
25832583
let mut first_outer_attr = first_outer_attr;
25842584
while self.token != term {
25852585
let cdir = @self.parse_crate_directive(first_outer_attr);
2586-
cdirs += [cdir]/~;
2586+
vec::push(cdirs, cdir);
25872587
first_outer_attr = []/~;
25882588
}
25892589
ret cdirs;

0 commit comments

Comments
 (0)