rustc: Add def ids to variants
This commit is contained in:
parent
25b973df1b
commit
567a45cc70
3 changed files with 5 additions and 3 deletions
|
@ -30,6 +30,7 @@ tag def {
|
|||
def_const(def_id);
|
||||
def_arg(def_id);
|
||||
def_local(def_id);
|
||||
def_variant(def_id);
|
||||
def_ty(def_id);
|
||||
def_ty_arg(def_id);
|
||||
}
|
||||
|
@ -173,7 +174,7 @@ type _fn = rec(vec[arg] inputs,
|
|||
type _mod = rec(vec[@item] items,
|
||||
hashmap[ident,uint] index);
|
||||
|
||||
type variant = rec(str name, vec[@ty] args);
|
||||
type variant = rec(str name, vec[@ty] args, def_id id);
|
||||
|
||||
type item = spanned[item_];
|
||||
tag item_ {
|
||||
|
|
|
@ -1260,7 +1260,8 @@ impure fn parse_item_tag(parser p) -> tup(ast.ident, @ast.item) {
|
|||
|
||||
expect(p, token.SEMI);
|
||||
|
||||
variants += vec(rec(name=name, args=args));
|
||||
auto id = p.next_def_id();
|
||||
variants += vec(rec(name=name, args=args, id=id));
|
||||
}
|
||||
case (token.RBRACE) { /* empty */ }
|
||||
case (_) {
|
||||
|
|
|
@ -594,7 +594,7 @@ fn fold_item[ENV](&ENV env, ast_fold[ENV] fld, @item i) -> @item {
|
|||
for (@ast.ty t in v.args) {
|
||||
new_args += vec(fold_ty[ENV](env_, fld, t));
|
||||
}
|
||||
new_variants += rec(name=v.name, args=new_args);
|
||||
new_variants += rec(name=v.name, args=new_args, id=v.id);
|
||||
}
|
||||
ret fld.fold_item_tag(env_, i.span, ident, new_variants,
|
||||
ty_params, id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue