about summary refs log tree commit diff
path: root/src/librustc
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-09-16 23:34:40 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-09-18 11:07:22 -0700
commit817576ee7001244da68a4ee315ebdc1163d4e648 (patch)
treeffa6ecd790e899105cfa3f2c2da1b4520a062f72 /src/librustc
parente02313a172acca34bd29e10cdd10f7495664694e (diff)
downloadrust-817576ee7001244da68a4ee315ebdc1163d4e648.tar.gz
rust-817576ee7001244da68a4ee315ebdc1163d4e648.zip
Register new snapshots
Diffstat (limited to 'src/librustc')
-rw-r--r--src/librustc/back/link.rs2
-rw-r--r--src/librustc/front/test.rs116
-rw-r--r--src/librustc/middle/trans/base.rs2
-rw-r--r--src/librustc/middle/trans/context.rs2
4 files changed, 3 insertions, 119 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 1fbbc1db05a..ee7fbed9e9f 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -190,7 +190,7 @@ pub mod jit {
 
     // The stage1 compiler won't work, but that doesn't really matter. TLS
     // changed only very recently to allow storage of owned values.
-    static engine_key: local_data::Key<~Engine> = &local_data::Key;
+    local_data_key!(engine_key: ~Engine)
 
     fn set_engine(engine: ~Engine) {
         local_data::set(engine_key, engine)
diff --git a/src/librustc/front/test.rs b/src/librustc/front/test.rs
index 9c788065133..49176c7bc17 100644
--- a/src/librustc/front/test.rs
+++ b/src/librustc/front/test.rs
@@ -293,50 +293,6 @@ fn mk_std(cx: &TestCtxt) -> ast::view_item {
     }
 }
 
-#[cfg(stage0)]
-fn mk_test_module(cx: &TestCtxt) -> @ast::item {
-
-    // Link to extra
-    let view_items = ~[mk_std(cx)];
-
-    // A constant vector of test descriptors.
-    let tests = mk_tests(cx);
-
-    // The synthesized main function which will call the console test runner
-    // with our list of tests
-    let ext_cx = cx.ext_cx;
-    let mainfn = (quote_item!(
-        pub fn main() {
-            #[main];
-            extra::test::test_main_static(::std::os::args(), TESTS);
-        }
-    )).unwrap();
-
-    let testmod = ast::_mod {
-        view_items: view_items,
-        items: ~[mainfn, tests],
-    };
-    let item_ = ast::item_mod(testmod);
-
-    // This attribute tells resolve to let us call unexported functions
-    let resolve_unexported_attr =
-        attr::mk_attr(attr::mk_word_item(@"!resolve_unexported"));
-
-    let item = ast::item {
-        ident: cx.sess.ident_of("__test"),
-        attrs: ~[resolve_unexported_attr],
-        id: ast::DUMMY_NODE_ID,
-        node: item_,
-        vis: ast::public,
-        span: dummy_sp(),
-     };
-
-    debug!("Synthetic test module:\n%s\n",
-           pprust::item_to_str(@item.clone(), cx.sess.intr()));
-
-    return @item;
-}
-#[cfg(not(stage0))]
 fn mk_test_module(cx: &TestCtxt) -> @ast::item {
 
     // Link to extra
@@ -407,21 +363,6 @@ fn path_node_global(ids: ~[ast::Ident]) -> ast::Path {
     }
 }
 
-#[cfg(stage0)]
-fn mk_tests(cx: &TestCtxt) -> @ast::item {
-
-    let ext_cx = cx.ext_cx;
-
-    // The vector of test_descs for this crate
-    let test_descs = mk_test_descs(cx);
-
-    (quote_item!(
-        pub static TESTS : &'static [self::extra::test::TestDescAndFn] =
-            $test_descs
-        ;
-    )).unwrap()
-}
-#[cfg(not(stage0))]
 fn mk_tests(cx: &TestCtxt) -> @ast::item {
     // The vector of test_descs for this crate
     let test_descs = mk_test_descs(cx);
@@ -461,63 +402,6 @@ fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
     }
 }
 
-#[cfg(stage0)]
-fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
-    let span = test.span;
-    let path = test.path.clone();
-
-    let ext_cx = cx.ext_cx;
-
-    debug!("encoding %s", ast_util::path_name_i(path));
-
-    let name_lit: ast::lit =
-        nospan(ast::lit_str(ast_util::path_name_i(path).to_managed()));
-
-    let name_expr = @ast::Expr {
-          id: ast::DUMMY_NODE_ID,
-          node: ast::ExprLit(@name_lit),
-          span: span
-    };
-
-    let fn_path = path_node_global(path);
-
-    let fn_expr = @ast::Expr {
-        id: ast::DUMMY_NODE_ID,
-        node: ast::ExprPath(fn_path),
-        span: span,
-    };
-
-    let t_expr = if test.bench {
-        quote_expr!( self::extra::test::StaticBenchFn($fn_expr) )
-    } else {
-        quote_expr!( self::extra::test::StaticTestFn($fn_expr) )
-    };
-
-    let ignore_expr = if test.ignore {
-        quote_expr!( true )
-    } else {
-        quote_expr!( false )
-    };
-
-    let fail_expr = if test.should_fail {
-        quote_expr!( true )
-    } else {
-        quote_expr!( false )
-    };
-
-    let e = quote_expr!(
-        self::extra::test::TestDescAndFn {
-            desc: self::extra::test::TestDesc {
-                name: self::extra::test::StaticTestName($name_expr),
-                ignore: $ignore_expr,
-                should_fail: $fail_expr
-            },
-            testfn: $t_expr,
-        }
-    );
-    e
-}
-#[cfg(not(stage0))]
 fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
     let span = test.span;
     let path = test.path.clone();
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index 3e18980ae38..4c679798bce 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -92,7 +92,7 @@ use syntax::visit::Visitor;
 
 pub use middle::trans::context::task_llcx;
 
-static task_local_insn_key: local_data::Key<@~[&'static str]> = &local_data::Key;
+local_data_key!(task_local_insn_key: @~[&'static str])
 
 pub fn with_insn_ctxt(blk: &fn(&[&'static str])) {
     let opt = local_data::get(task_local_insn_key, |k| k.map_move(|k| *k));
diff --git a/src/librustc/middle/trans/context.rs b/src/librustc/middle/trans/context.rs
index 7e1c2c369b1..e342bcaf4fa 100644
--- a/src/librustc/middle/trans/context.rs
+++ b/src/librustc/middle/trans/context.rs
@@ -287,7 +287,7 @@ impl Drop for CrateContext {
     }
 }
 
-static task_local_llcx_key: local_data::Key<@ContextRef> = &local_data::Key;
+local_data_key!(task_local_llcx_key: @ContextRef)
 
 pub fn task_llcx() -> ContextRef {
     let opt = local_data::get(task_local_llcx_key, |k| k.map_move(|k| *k));