Skip to content

Commit 810f488

Browse files
committed
---
yaml --- r: 13308 b: refs/heads/master c: 22cf4b9 h: refs/heads/master v: v3
1 parent 1f48148 commit 810f488

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2adb3a5013c2a2d1fdbb27c0fb07a07aa2b83171
2+
refs/heads/master: 22cf4b9ac381db02c0db4f81b205f671af844aa5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/front/test.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import syntax::codemap::span;
99
import driver::session;
1010
import session::session;
1111
import syntax::attr;
12+
import dvec::{dvec, extensions};
1213

1314
export modify_for_testing;
1415

@@ -20,7 +21,7 @@ type test_ctxt =
2021
@{sess: session::session,
2122
crate: @ast::crate,
2223
mut path: [ast::ident],
23-
mut testfns: [test]};
24+
testfns: dvec<test>};
2425

2526
// Traverse the crate, collecting all the test functions, eliding any
2627
// existing main functions, and synthesizing a main test harness
@@ -40,7 +41,7 @@ fn generate_test_harness(sess: session::session,
4041
@{sess: sess,
4142
crate: crate,
4243
mut path: [],
43-
mut testfns: []};
44+
testfns: dvec()};
4445

4546
let precursor =
4647
@{fold_crate: fold::wrap(bind fold_crate(cx, _, _)),
@@ -110,8 +111,8 @@ fn fold_item(cx: test_ctxt, &&i: @ast::item, fld: fold::ast_fold) ->
110111
let test = {span: i.span,
111112
path: cx.path, ignore: is_ignored(cx, i),
112113
should_fail: should_fail(i)};
113-
cx.testfns += [test];
114-
#debug("have %u test functions", vec::len(cx.testfns));
114+
cx.testfns.push(test);
115+
#debug("have %u test functions", cx.testfns.len());
115116
}
116117
}
117118
}
@@ -269,11 +270,10 @@ fn mk_test_desc_vec_ty(cx: test_ctxt) -> @ast::ty {
269270
}
270271

271272
fn mk_test_desc_vec(cx: test_ctxt) -> @ast::expr {
272-
#debug("building test vector from %u tests", vec::len(cx.testfns));
273+
#debug("building test vector from %u tests", cx.testfns.len());
273274
let mut descs = [];
274275
for cx.testfns.each {|test|
275-
let test_ = test; // Satisfy alias analysis
276-
descs += [mk_test_desc_rec(cx, test_)];
276+
descs += [mk_test_desc_rec(cx, test)];
277277
}
278278

279279
ret @{id: cx.sess.next_node_id(),

0 commit comments

Comments
 (0)