Print tag names in type error messages. Closes #834.
This commit is contained in:
parent
4a894dae8e
commit
f8ac788d66
4 changed files with 31 additions and 14 deletions
|
|
@ -36,6 +36,7 @@ import syntax::print::pprust::*;
|
|||
|
||||
export resolve_crate;
|
||||
export def_map;
|
||||
export ext_map;
|
||||
|
||||
// Resolving happens in two passes. The first pass collects defids of all
|
||||
// (internal) imports and modules, so that they can be looked up when needed,
|
||||
|
|
@ -113,6 +114,7 @@ type indexed_mod =
|
|||
only need to look at them to determine exports, which they can't control.*/
|
||||
|
||||
type def_map = hashmap<node_id, def>;
|
||||
type ext_map = hashmap<def_id, [ident]>;
|
||||
|
||||
type env =
|
||||
{cstore: cstore::cstore,
|
||||
|
|
@ -133,7 +135,7 @@ tag dir { inside; outside; }
|
|||
tag namespace { ns_value; ns_type; ns_module; }
|
||||
|
||||
fn resolve_crate(sess: session, amap: &ast_map::map, crate: @ast::crate) ->
|
||||
def_map {
|
||||
{def_map: def_map, ext_map: ext_map} {
|
||||
let e =
|
||||
@{cstore: sess.get_cstore(),
|
||||
def_map: new_int_hash::<def>(),
|
||||
|
|
@ -148,7 +150,7 @@ fn resolve_crate(sess: session, amap: &ast_map::map, crate: @ast::crate) ->
|
|||
resolve_imports(*e);
|
||||
check_for_collisions(e, *crate);
|
||||
resolve_names(e, crate);
|
||||
ret e.def_map;
|
||||
ret {def_map: e.def_map, ext_map: e.ext_map};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -212,6 +212,9 @@ type ctxt =
|
|||
@{ts: @type_store,
|
||||
sess: session::session,
|
||||
def_map: resolve::def_map,
|
||||
// We need the ext_map just for printing the types of tags defined in
|
||||
// other crates. Once we get cnames back it should go.
|
||||
ext_map: resolve::ext_map,
|
||||
node_types: node_type_table,
|
||||
items: ast_map::map,
|
||||
freevars: freevars::freevar_map,
|
||||
|
|
@ -392,7 +395,8 @@ fn mk_rcache() -> creader_cache {
|
|||
}
|
||||
|
||||
|
||||
fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map,
|
||||
fn mk_ctxt(s: session::session, dm: resolve::def_map,
|
||||
em: hashmap<def_id, [ident]>, amap: ast_map::map,
|
||||
freevars: freevars::freevar_map) -> ctxt {
|
||||
let ntt: node_type_table =
|
||||
@smallintmap::mk::<ty::ty_param_substs_opt_and_ty>();
|
||||
|
|
@ -402,6 +406,7 @@ fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map,
|
|||
@{ts: ts,
|
||||
sess: s,
|
||||
def_map: dm,
|
||||
ext_map: em,
|
||||
node_types: ntt,
|
||||
items: amap,
|
||||
freevars: freevars,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue