about summary refs log tree commit diff
path: root/src/librustc/front/test.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-04 16:01:44 -0700
committerbors <bors@rust-lang.org>2014-04-04 16:01:44 -0700
commit4cf8d8ce69c1d1d10e90b04230d4c4e8dbb67bcc (patch)
tree61f1237167d3663ba874e2b802cd9f5dd3c57041 /src/librustc/front/test.rs
parente5f1b9f6dc9418325f83d9766c7cfab30cb48018 (diff)
parent6d43138b75f009bfa6f0774953ef55fd91e9760a (diff)
auto merge of #13326 : alexcrichton/rust/rollup, r=alexcrichton
Closes #13313 (Fix typo in README.md)
Closes #13311 (Fix inner attribute syntax from `#[foo];` to `#![foo]`)
Closes #13309 (Add stdlib docs to the Linux binary tarball.)
Closes #13308 (syntax: remove obsolete mutability from ExprVec and ExprRepeat.)
Closes #13306 (TrieSet should impl Set/MutableSet; add with_capacity to PriorityQueue/SmallIntMap)
Closes #13303 (Register new snapshots)
Closes #13274 (Added grow_fn and retain to Vec)

*Issues Closed*

Closes #13249
Diffstat (limited to 'src/librustc/front/test.rs')
-rw-r--r--src/librustc/front/test.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs
index 82e2e3147c9..86d2e039505 100644
--- a/src/librustc/front/test.rs
+++ b/src/librustc/front/test.rs
@@ -404,21 +404,17 @@ fn is_test_crate(krate: &ast::Crate) -> bool {
 }
 
 fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
-    let mut descs = Vec::new();
     debug!("building test vector from {} tests", cx.testfns.borrow().len());
-    for test in cx.testfns.borrow().iter() {
-        descs.push(mk_test_desc_and_fn_rec(cx, test));
-    }
-
-    let inner_expr = @ast::Expr {
-        id: ast::DUMMY_NODE_ID,
-        node: ast::ExprVec(descs, ast::MutImmutable),
-        span: DUMMY_SP,
-    };
 
     @ast::Expr {
         id: ast::DUMMY_NODE_ID,
-        node: ast::ExprVstore(inner_expr, ast::ExprVstoreSlice),
+        node: ast::ExprVstore(@ast::Expr {
+            id: ast::DUMMY_NODE_ID,
+            node: ast::ExprVec(cx.testfns.borrow().iter().map(|test| {
+                mk_test_desc_and_fn_rec(cx, test)
+            }).collect()),
+            span: DUMMY_SP,
+        }, ast::ExprVstoreSlice),
         span: DUMMY_SP,
     }
 }