diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-06-10 00:49:59 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-06-13 11:30:45 -0700 |
| commit | ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a (patch) | |
| tree | 55c2ee5be0986c2489879022d4788d6c3ac2c964 /src/rustc/front | |
| parent | bdd20000665a35e14b4ec2c54f893fc80fe451ef (diff) | |
| download | rust-ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a.tar.gz rust-ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a.zip | |
Box AST idents
Diffstat (limited to 'src/rustc/front')
| -rw-r--r-- | src/rustc/front/core_inject.rs | 4 | ||||
| -rw-r--r-- | src/rustc/front/test.rs | 36 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/rustc/front/core_inject.rs b/src/rustc/front/core_inject.rs index 590a371da07..bc7048f8f09 100644 --- a/src/rustc/front/core_inject.rs +++ b/src/rustc/front/core_inject.rs @@ -30,11 +30,11 @@ fn inject_libcore_ref(sess: session, let n1 = sess.next_node_id(); let n2 = sess.next_node_id(); - let vi1 = @{node: ast::view_item_use("core", [], n1), + let vi1 = @{node: ast::view_item_use(@"core", [], n1), attrs: [], vis: ast::public, span: dummy_sp()}; - let vp = spanned(ast::view_path_glob(ident_to_path(dummy_sp(), "core"), + let vp = spanned(ast::view_path_glob(ident_to_path(dummy_sp(), @"core"), n2)); let vi2 = @{node: ast::view_item_import([vp]), attrs: [], diff --git a/src/rustc/front/test.rs b/src/rustc/front/test.rs index 2cb144a60b5..44b9356896b 100644 --- a/src/rustc/front/test.rs +++ b/src/rustc/front/test.rs @@ -70,7 +70,7 @@ fn fold_mod(_cx: test_ctxt, m: ast::_mod, fld: fold::ast_fold) -> ast::_mod { fn nomain(&&item: @ast::item) -> option<@ast::item> { alt item.node { ast::item_fn(_, _, _) { - if item.ident == "main" { + if *item.ident == "main" { option::none } else { option::some(item) } } @@ -190,9 +190,9 @@ fn mk_test_module(cx: test_ctxt) -> @ast::item { 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")); + attr::mk_attr(attr::mk_word_item(@"!resolve_unexported")); let item: ast::item = - {ident: "__test", + {ident: @"__test", attrs: [resolve_unexported_attr], id: cx.sess.next_node_id(), node: item_, @@ -231,7 +231,7 @@ fn mk_tests(cx: test_ctxt) -> @ast::item { let item_ = ast::item_fn(decl, [], body); let item: ast::item = - {ident: "tests", + {ident: @"tests", attrs: [], id: cx.sess.next_node_id(), node: item_, @@ -246,16 +246,16 @@ fn mk_path(cx: test_ctxt, path: [ast::ident]) -> [ast::ident] { let is_std = { let items = attr::find_linkage_metas(cx.crate.node.attrs); alt attr::last_meta_item_value_str_by_name(items, "name") { - some("std") { true } + some(@"std") { true } _ { false } } }; - (if is_std { [] } else { ["std"] }) + path + (if is_std { [] } else { [@"std"] }) + path } // The ast::ty of [std::test::test_desc] fn mk_test_desc_vec_ty(cx: test_ctxt) -> @ast::ty { - let test_desc_ty_path = path_node(mk_path(cx, ["test", "test_desc"])); + let test_desc_ty_path = path_node(mk_path(cx, [@"test", @"test_desc"])); let test_desc_ty: ast::ty = {id: cx.sess.next_node_id(), @@ -288,14 +288,14 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { #debug("encoding %s", ast_util::path_name_i(path)); let name_lit: ast::lit = - nospan(ast::lit_str(ast_util::path_name_i(path))); + nospan(ast::lit_str(@ast_util::path_name_i(path))); let name_expr: ast::expr = {id: cx.sess.next_node_id(), node: ast::expr_lit(@name_lit), span: span}; let name_field: ast::field = - nospan({mutbl: ast::m_imm, ident: "name", expr: @name_expr}); + nospan({mutbl: ast::m_imm, ident: @"name", expr: @name_expr}); let fn_path = path_node(path); @@ -307,7 +307,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { let fn_wrapper_expr = mk_test_wrapper(cx, fn_expr, span); let fn_field: ast::field = - nospan({mutbl: ast::m_imm, ident: "fn", expr: fn_wrapper_expr}); + nospan({mutbl: ast::m_imm, ident: @"fn", expr: fn_wrapper_expr}); let ignore_lit: ast::lit = nospan(ast::lit_bool(test.ignore)); @@ -317,7 +317,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { span: span}; let ignore_field: ast::field = - nospan({mutbl: ast::m_imm, ident: "ignore", expr: @ignore_expr}); + nospan({mutbl: ast::m_imm, ident: @"ignore", expr: @ignore_expr}); let fail_lit: ast::lit = nospan(ast::lit_bool(test.should_fail)); @@ -327,7 +327,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr { span: span}; let fail_field: ast::field = - nospan({mutbl: ast::m_imm, ident: "should_fail", expr: @fail_expr}); + nospan({mutbl: ast::m_imm, ident: @"should_fail", expr: @fail_expr}); let desc_rec_: ast::expr_ = ast::expr_rec([name_field, fn_field, ignore_field, fail_field], @@ -379,7 +379,7 @@ fn mk_test_wrapper(cx: test_ctxt, } fn mk_main(cx: test_ctxt) -> @ast::item { - let str_pt = path_node(["str"]); + let str_pt = path_node([@"str"]); let str_ty = @{id: cx.sess.next_node_id(), node: ast::ty_path(str_pt, cx.sess.next_node_id()), span: dummy_sp()}; @@ -391,7 +391,7 @@ fn mk_main(cx: test_ctxt) -> @ast::item { let args_arg: ast::arg = {mode: ast::expl(ast::by_val), ty: @args_ty, - ident: "args", + ident: @"args", id: cx.sess.next_node_id()}; let ret_ty = {id: cx.sess.next_node_id(), @@ -414,7 +414,7 @@ fn mk_main(cx: test_ctxt) -> @ast::item { let item_ = ast::item_fn(decl, [], body); let item: ast::item = - {ident: "main", + {ident: @"main", attrs: [], id: cx.sess.next_node_id(), node: item_, @@ -426,7 +426,7 @@ fn mk_main(cx: test_ctxt) -> @ast::item { fn mk_test_main_call(cx: test_ctxt) -> @ast::expr { // Get the args passed to main so we can pass the to test_main - let args_path = path_node(["args"]); + let args_path = path_node([@"args"]); let args_path_expr_: ast::expr_ = ast::expr_path(args_path); @@ -434,7 +434,7 @@ fn mk_test_main_call(cx: test_ctxt) -> @ast::expr { {id: cx.sess.next_node_id(), node: args_path_expr_, span: dummy_sp()}; // Call __test::test to generate the vector of test_descs - let test_path = path_node(["tests"]); + let test_path = path_node([@"tests"]); let test_path_expr_: ast::expr_ = ast::expr_path(test_path); @@ -447,7 +447,7 @@ fn mk_test_main_call(cx: test_ctxt) -> @ast::expr { {id: cx.sess.next_node_id(), node: test_call_expr_, span: dummy_sp()}; // Call std::test::test_main - let test_main_path = path_node(mk_path(cx, ["test", "test_main"])); + let test_main_path = path_node(mk_path(cx, [@"test", @"test_main"])); let test_main_path_expr_: ast::expr_ = ast::expr_path(test_main_path); |
