Support prefix notation for vstore strings. Closes #2906.

This commit is contained in:
Michael Sullivan 2012-07-12 15:03:33 -07:00
parent e4de160222
commit 985b52be6d
46 changed files with 252 additions and 237 deletions

View file

@ -51,13 +51,13 @@ fn default_configuration(sess: session, argv0: str, input: input) ->
ret ~[ // Target bindings.
attr::mk_word_item(@os::family()),
mk(@"target_os", os::sysname()),
mk(@"target_family", os::family()),
mk(@"target_arch", arch),
mk(@"target_libc", libc),
mk(@"target_os"/~, os::sysname()),
mk(@"target_family"/~, os::family()),
mk(@"target_arch"/~, arch),
mk(@"target_libc"/~, libc),
// Build bindings.
mk(@"build_compiler", argv0),
mk(@"build_input", source_name(input))];
mk(@"build_compiler"/~, argv0),
mk(@"build_input"/~, source_name(input))];
}
fn build_configuration(sess: session, argv0: str, input: input) ->
@ -71,7 +71,7 @@ fn build_configuration(sess: session, argv0: str, input: input) ->
{
if sess.opts.test && !attr::contains_name(user_cfg, "test")
{
~[attr::mk_word_item(@"test")]
~[attr::mk_word_item(@"test"/~)]
} else { ~[] }
};
ret vec::append(vec::append(user_cfg, gen_cfg), default_cfg);

View file

@ -217,7 +217,7 @@ fn building_library(req_crate_type: crate_type, crate: @ast::crate,
alt syntax::attr::first_attr_value_str_by_name(
crate.node.attrs,
"crate_type") {
option::some(@"lib") { true }
option::some(@"lib"/~) { true }
_ { false }
}
}
@ -245,7 +245,7 @@ mod test {
style: ast::attr_outer,
value: ast_util::respan(ast_util::dummy_sp(),
ast::meta_name_value(
@"crate_type",
@"crate_type"/~,
ast_util::respan(ast_util::dummy_sp(),
ast::lit_str(@t)))),
is_sugared_doc: false

View file

@ -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: ~[],

View file

@ -192,9 +192,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_,
@ -233,7 +233,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_,
@ -248,17 +248,18 @@ 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 { path }
else { vec::append(~[@"std"], path) }
else { vec::append(~[@"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(),
@ -307,7 +308,7 @@ fn mk_test_desc_rec(cx: test_ctxt, test: test) -> @ast::expr {
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);
@ -320,7 +321,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));
@ -331,7 +332,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));
@ -342,7 +343,9 @@ 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],
@ -397,7 +400,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()};
@ -413,7 +416,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(),
@ -436,7 +439,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_,
@ -448,7 +451,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);
@ -457,7 +460,7 @@ fn mk_test_main_call(cx: test_ctxt) -> @ast::expr {
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);
@ -472,7 +475,7 @@ fn mk_test_main_call(cx: test_ctxt) -> @ast::expr {
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);

View file

@ -49,7 +49,7 @@ fn dump_crates(crate_cache: dvec<cache_entry>) {
#debug("span: %?", entry.span);
#debug("hash: %?", entry.hash);
let attrs = ~[
attr::mk_attr(attr::mk_list_item(@"link", *entry.metas))
attr::mk_attr(attr::mk_list_item(@"link"/~, *entry.metas))
];
for attr::find_linkage_attrs(attrs).each |attr| {
#debug("meta: %s", pprust::attr_to_str(attr));
@ -81,7 +81,7 @@ fn warn_if_multiple_versions(diag: span_handler,
for matches.each |match| {
diag.span_note(match.span, "used here");
let attrs = ~[
attr::mk_attr(attr::mk_list_item(@"link", *match.metas))
attr::mk_attr(attr::mk_list_item(@"link"/~, *match.metas))
];
loader::note_linkage_attrs(diag, attrs);
}
@ -168,7 +168,7 @@ fn metas_with(ident: ast::ident, key: ast::ident,
fn metas_with_ident(ident: ast::ident,
metas: ~[@ast::meta_item]) -> ~[@ast::meta_item] {
metas_with(ident, @"name", metas)
metas_with(ident, @"name"/~, metas)
}
fn existing_match(e: env, metas: ~[@ast::meta_item], hash: str) ->
@ -245,7 +245,7 @@ fn resolve_crate_deps(e: env, cdata: @~[u8]) -> cstore::cnum_map {
for decoder::get_crate_deps(cdata).each |dep| {
let extrn_cnum = dep.cnum;
let cname = dep.name;
let cmetas = metas_with(dep.vers, @"vers", ~[]);
let cmetas = metas_with(dep.vers, @"vers"/~, ~[]);
#debug("resolving dep crate %s ver: %s hash: %s",
*dep.name, *dep.vers, *dep.hash);
alt existing_match(e, metas_with_ident(cname, cmetas), *dep.hash) {

View file

@ -833,7 +833,7 @@ fn get_crate_vers(data: @~[u8]) -> @str/~ {
ret alt attr::last_meta_item_value_str_by_name(
attr::find_linkage_metas(attrs), "vers") {
some(ver) { ver }
none { @"0.0" }
none { @"0.0"/~ }
};
}

View file

@ -802,7 +802,7 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::writer,
ebml_w.start_tag(tag_items_data);
vec::push(*index, {val: crate_node_id, pos: ebml_w.writer.tell()});
encode_info_for_mod(ecx, ebml_w, crate.node.module,
crate_node_id, ~[], @"");
crate_node_id, ~[], @""/~);
visit::visit_crate(*crate, (), visit::mk_vt(@{
visit_expr: |_e, _cx, _v| { },
visit_item: |i, cx, v, copy ebml_w| {
@ -952,18 +952,18 @@ fn synthesize_crate_attrs(ecx: @encode_ctxt, crate: @crate) -> ~[attribute] {
assert (*ecx.link_meta.vers != "");
let name_item =
attr::mk_name_value_item_str(@"name", *ecx.link_meta.name);
attr::mk_name_value_item_str(@"name"/~, *ecx.link_meta.name);
let vers_item =
attr::mk_name_value_item_str(@"vers", *ecx.link_meta.vers);
attr::mk_name_value_item_str(@"vers"/~, *ecx.link_meta.vers);
let other_items =
{
let tmp = attr::remove_meta_items_by_name(items, @"name");
attr::remove_meta_items_by_name(tmp, @"vers")
let tmp = attr::remove_meta_items_by_name(items, @"name"/~);
attr::remove_meta_items_by_name(tmp, @"vers"/~)
};
let meta_items = vec::append(~[name_item, vers_item], other_items);
let link_item = attr::mk_list_item(@"link", meta_items);
let link_item = attr::mk_list_item(@"link"/~, meta_items);
ret attr::mk_attr(link_item);
}

View file

@ -67,8 +67,8 @@ fn check_exhaustive(tcx: ty::ctxt, sp: span, pats: ~[@pat]) {
alt ty::get(ty).struct {
ty::ty_bool {
alt check ctor {
val(const_int(1i64)) { some(@"true") }
val(const_int(0i64)) { some(@"false") }
val(const_int(1i64)) { some(@"true"/~) }
val(const_int(0i64)) { some(@"false"/~) }
}
}
ty::ty_enum(id, _) {

View file

@ -458,7 +458,7 @@ fn check_item_old_vecs(cx: ty::ctxt, it: @ast::item) {
}
ast::ty_path(@{span: _, global: _, idents: ids,
rp: none, types: _}, _)
if ids == ~[@"str"] && (! uses_vstore.contains_key(t.id)) {
if ids == ~[@"str"/~] && (! uses_vstore.contains_key(t.id)) {
cx.sess.span_lint(
old_strs, t.id, it.id,
t.span, "deprecated str type");

View file

@ -290,8 +290,8 @@ class ir_maps {
alt self.var_kinds[*var] {
vk_local(_, name) | vk_arg(_, name, _) {name}
vk_field(name) {@("self." + *name)}
vk_self {@"self"}
vk_implicit_ret {@"<implicit-ret>"}
vk_self {@"self"/~}
vk_implicit_ret {@"<implicit-ret>"/~}
}
}

View file

@ -505,7 +505,7 @@ impl methods for determine_rp_ctxt {
fn region_is_relevant(r: @ast::region) -> bool {
alt r.node {
ast::re_anon {self.anon_implies_rp}
ast::re_named(@"self") {true}
ast::re_named(@"self"/~) {true}
ast::re_named(_) {false}
}
}

View file

@ -885,7 +885,7 @@ fn resolve_import(e: env, n_id: node_id, name: ast::ident,
// import
alt e.imports.find(n_id) {
some(resolving(sp)) {
e.imports.insert(n_id, resolved(none, none, none, @~[], @"", sp));
e.imports.insert(n_id, resolved(none, none, none, @~[], @""/~, sp));
}
_ { }
}

View file

@ -560,22 +560,22 @@ class PrimitiveTypeTable {
new(atom_table: @AtomTable) {
self.primitive_types = atom_hashmap();
self.intern(atom_table, @"bool", ty_bool);
self.intern(atom_table, @"char", ty_int(ty_char));
self.intern(atom_table, @"float", ty_float(ty_f));
self.intern(atom_table, @"f32", ty_float(ty_f32));
self.intern(atom_table, @"f64", ty_float(ty_f64));
self.intern(atom_table, @"int", ty_int(ty_i));
self.intern(atom_table, @"i8", ty_int(ty_i8));
self.intern(atom_table, @"i16", ty_int(ty_i16));
self.intern(atom_table, @"i32", ty_int(ty_i32));
self.intern(atom_table, @"i64", ty_int(ty_i64));
self.intern(atom_table, @"str", ty_str);
self.intern(atom_table, @"uint", ty_uint(ty_u));
self.intern(atom_table, @"u8", ty_uint(ty_u8));
self.intern(atom_table, @"u16", ty_uint(ty_u16));
self.intern(atom_table, @"u32", ty_uint(ty_u32));
self.intern(atom_table, @"u64", ty_uint(ty_u64));
self.intern(atom_table, @"bool"/~, ty_bool);
self.intern(atom_table, @"char"/~, ty_int(ty_char));
self.intern(atom_table, @"float"/~, ty_float(ty_f));
self.intern(atom_table, @"f32"/~, ty_float(ty_f32));
self.intern(atom_table, @"f64"/~, ty_float(ty_f64));
self.intern(atom_table, @"int"/~, ty_int(ty_i));
self.intern(atom_table, @"i8"/~, ty_int(ty_i8));
self.intern(atom_table, @"i16"/~, ty_int(ty_i16));
self.intern(atom_table, @"i32"/~, ty_int(ty_i32));
self.intern(atom_table, @"i64"/~, ty_int(ty_i64));
self.intern(atom_table, @"str"/~, ty_str);
self.intern(atom_table, @"uint"/~, ty_uint(ty_u));
self.intern(atom_table, @"u8"/~, ty_uint(ty_u8));
self.intern(atom_table, @"u16"/~, ty_uint(ty_u16));
self.intern(atom_table, @"u32"/~, ty_uint(ty_u32));
self.intern(atom_table, @"u64"/~, ty_uint(ty_u64));
}
fn intern(atom_table: @AtomTable, string: @str/~,
@ -651,7 +651,7 @@ class Resolver {
self.type_ribs = @dvec();
self.xray_context = NoXray;
self.self_atom = (*self.atom_table).intern(@"self");
self.self_atom = (*self.atom_table).intern(@"self"/~);
self.primitive_type_table = @PrimitiveTypeTable(self.atom_table);
self.namespaces = ~[ ModuleNS, TypeNS, ValueNS, ImplNS ];
@ -4234,7 +4234,7 @@ class Resolver {
current_module = module;
}
BlockParentLink(module, node_id) {
atoms.push((*self.atom_table).intern(@"<opaque>"));
atoms.push((*self.atom_table).intern(@"<opaque>"/~));
current_module = module;
}
}

View file

@ -486,8 +486,8 @@ fn declare_tydesc(ccx: @crate_ctxt, t: ty::t) -> @tydesc_info {
let llalign = llalign_of(ccx, llty);
//XXX this triggers duplicate LLVM symbols
let name = if false /*ccx.sess.opts.debuginfo*/ {
mangle_internal_name_by_type_only(ccx, t, @"tydesc")
} else { mangle_internal_name_by_seq(ccx, @"tydesc") };
mangle_internal_name_by_type_only(ccx, t, @"tydesc"/~)
} else { mangle_internal_name_by_seq(ccx, @"tydesc"/~) };
note_unique_llvm_symbol(ccx, name);
log(debug, #fmt("+++ declare_tydesc %s %s", ty_to_str(ccx.tcx, t), name));
let gvar = str::as_c_str(name, |buf| {
@ -667,8 +667,8 @@ fn incr_refcnt_of_boxed(cx: block, box_ptr: ValueRef) {
fn make_visit_glue(bcx: block, v: ValueRef, t: ty::t) {
let _icx = bcx.insn_ctxt("make_visit_glue");
let mut bcx = bcx;
assert bcx.ccx().tcx.intrinsic_defs.contains_key(@"ty_visitor");
let (iid, ty) = bcx.ccx().tcx.intrinsic_defs.get(@"ty_visitor");
assert bcx.ccx().tcx.intrinsic_defs.contains_key(@"ty_visitor"/~);
let (iid, ty) = bcx.ccx().tcx.intrinsic_defs.get(@"ty_visitor"/~);
let v = PointerCast(bcx, v, T_ptr(type_of::type_of(bcx.ccx(), ty)));
bcx = reflect::emit_calls_to_trait_visit_ty(bcx, t, v, iid);
build_return(bcx);
@ -2131,7 +2131,7 @@ fn monomorphic_fn(ccx: @crate_ctxt, fn_id: ast::def_id,
must_cast: true};
}
ast_map::node_ctor(nm, _, ct, _, pt) { (pt, nm, ct.span) }
ast_map::node_dtor(_, dtor, _, pt) {(pt, @"drop", dtor.span)}
ast_map::node_dtor(_, dtor, _, pt) {(pt, @"drop"/~, dtor.span)}
ast_map::node_expr(*) { ccx.tcx.sess.bug("Can't monomorphize an expr") }
ast_map::node_export(*) {
ccx.tcx.sess.bug("Can't monomorphize an export")
@ -3825,7 +3825,7 @@ fn trans_log(log_ex: @ast::expr, lvl: @ast::expr,
ccx.module_data.get(modname)
} else {
let s = link::mangle_internal_name_by_path_and_seq(
ccx, modpath, @"loglevel");
ccx, modpath, @"loglevel"/~);
let global = str::as_c_str(s, |buf| {
llvm::LLVMAddGlobal(ccx.llmod, T_i32(), buf)
});
@ -4563,7 +4563,7 @@ fn trans_enum_variant(ccx: @crate_ctxt, enum_id: ast::node_id,
let fn_args = vec::map(variant.node.args, |varg|
{mode: ast::expl(ast::by_copy),
ty: varg.ty,
ident: @"arg",
ident: @"arg"/~,
id: varg.id});
let fcx = new_fn_ctxt_w_id(ccx, ~[], llfndecl, variant.node.id,
param_substs, none);
@ -5215,7 +5215,7 @@ fn trans_constant(ccx: @crate_ctxt, it: @ast::item) {
let path = item_path(ccx, it);
for vec::each(variants) |variant| {
let p = vec::append(path, ~[path_name(variant.node.name),
path_name(@"discrim")]);
path_name(@"discrim"/~)]);
let s = mangle_exported_name(ccx, p, ty::mk_int(ccx.tcx));
let disr_val = vi[i].disr_val;
note_unique_llvm_symbol(ccx, s);

View file

@ -365,7 +365,7 @@ fn trans_expr_fn(bcx: block,
let ccx = bcx.ccx(), bcx = bcx;
let fty = node_id_type(bcx, id);
let llfnty = type_of_fn_from_ty(ccx, fty);
let sub_path = vec::append_one(bcx.fcx.path, path_name(@"anon"));
let sub_path = vec::append_one(bcx.fcx.path, path_name(@"anon"/~));
let s = mangle_internal_name_by_path(ccx, sub_path);
let llfn = decl_internal_cdecl_fn(ccx.llmod, s, llfnty);

View file

@ -1001,7 +1001,7 @@ fn trans_foreign_fn(ccx: @crate_ctxt, path: ast_map::path, decl: ast::fn_decl,
let _icx = ccx.insn_ctxt("foreign::foreign::build_rust_fn");
let t = ty::node_id_to_type(ccx.tcx, id);
let ps = link::mangle_internal_name_by_path(
ccx, vec::append_one(path, ast_map::path_name(@"__rust_abi")));
ccx, vec::append_one(path, ast_map::path_name(@"__rust_abi"/~)));
let llty = type_of_fn_from_ty(ccx, t);
let llfndecl = decl_internal_cdecl_fn(ccx.llmod, ps, llty);
trans_fn(ccx, path, decl, body, llfndecl, no_self, none, id);
@ -1039,7 +1039,7 @@ fn trans_foreign_fn(ccx: @crate_ctxt, path: ast_map::path, decl: ast::fn_decl,
let shim_name = link::mangle_internal_name_by_path(
ccx, vec::append_one(path,
ast_map::path_name(@"__rust_stack_shim")));
ast_map::path_name(@"__rust_stack_shim"/~)));
ret build_shim_fn_(ccx, shim_name, llrustfn, tys,
lib::llvm::CCallConv,
build_args, build_ret);

View file

@ -297,8 +297,8 @@ fn emit_calls_to_trait_visit_ty(bcx: block, t: ty::t,
visitor_iid: def_id) -> block {
let final = sub_block(bcx, "final");
assert bcx.ccx().tcx.intrinsic_defs.contains_key(@"tydesc");
let (_, tydesc_ty) = bcx.ccx().tcx.intrinsic_defs.get(@"tydesc");
assert bcx.ccx().tcx.intrinsic_defs.contains_key(@"tydesc"/~);
let (_, tydesc_ty) = bcx.ccx().tcx.intrinsic_defs.get(@"tydesc"/~);
let tydesc_ty = type_of::type_of(bcx.ccx(), tydesc_ty);
let r = reflector({
visitor_val: visitor_val,

View file

@ -730,7 +730,7 @@ fn simplify_type(tcx: ty::ctxt, typ: ty::t) -> ty::t {
ty::ty_class(did, substs) {
let simpl_fields = (if is_some(ty::ty_dtor(tcx, did)) {
// remember the drop flag
~[{ident: @"drop", mt: {ty:
~[{ident: @"drop"/~, mt: {ty:
ty::mk_u8(tcx),
mutbl: ast::m_mutbl}}] }
else { ~[] }) +

View file

@ -2661,7 +2661,7 @@ fn item_path(cx: ctxt, id: ast::def_id) -> ast_map::path {
vec::append_one(*path, ast_map::path_name(nm))
}
ast_map::node_dtor(_, _, _, path) {
vec::append_one(*path, ast_map::path_name(@"dtor"))
vec::append_one(*path, ast_map::path_name(@"dtor"/~))
}

View file

@ -1625,7 +1625,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt,
let p_ty = fcx.expr_ty(p);
let lkup = method::lookup(fcx, p, p, expr.id, alloc_id,
@"alloc", p_ty, ~[], false);
@"alloc"/~, p_ty, ~[], false);
alt lkup.method() {
some(entry) {
fcx.ccx.method_map.insert(alloc_id, entry);
@ -2282,10 +2282,10 @@ fn check_intrinsic_type(ccx: @crate_ctxt, it: @ast::foreign_item) {
(1u, ~[], ty::mk_nil_ptr(tcx))
}
"visit_tydesc" {
assert ccx.tcx.intrinsic_defs.contains_key(@"tydesc");
assert ccx.tcx.intrinsic_defs.contains_key(@"ty_visitor");
let (_, tydesc_ty) = ccx.tcx.intrinsic_defs.get(@"tydesc");
let (_, visitor_trait) = ccx.tcx.intrinsic_defs.get(@"ty_visitor");
assert ccx.tcx.intrinsic_defs.contains_key(@"tydesc"/~);
assert ccx.tcx.intrinsic_defs.contains_key(@"ty_visitor"/~);
let (_, tydesc_ty) = ccx.tcx.intrinsic_defs.get(@"tydesc"/~);
let (_, visitor_trait) = ccx.tcx.intrinsic_defs.get(@"ty_visitor"/~);
let td_ptr = ty::mk_ptr(ccx.tcx, {ty: tydesc_ty,
mutbl: ast::m_imm});
(0u, ~[arg(ast::by_val, td_ptr),

View file

@ -74,7 +74,7 @@ fn local_rhs_span(l: @ast::local, def: span) -> span {
fn is_main_name(path: syntax::ast_map::path) -> bool {
// FIXME (#34): path should be a constrained type, so we know
// the call to last doesn't fail.
vec::last(path) == syntax::ast_map::path_name(@"main")
vec::last(path) == syntax::ast_map::path_name(@"main"/~)
}
//