rustc: Add a type annotation to tag items

This commit is contained in:
Patrick Walton 2011-03-31 19:12:40 -07:00
parent 1eeedbd008
commit c66edca83d
9 changed files with 35 additions and 36 deletions

View file

@ -404,7 +404,7 @@ tag item_ {
item_mod(ident, _mod, def_id);
item_native_mod(ident, native_mod, def_id);
item_ty(ident, @ty, vec[ty_param], def_id, ann);
item_tag(ident, vec[variant], vec[ty_param], def_id);
item_tag(ident, vec[variant], vec[ty_param], def_id, ann);
item_obj(ident, _obj, vec[ty_param], obj_def_ids, ann);
}
@ -448,7 +448,7 @@ fn index_item(mod_index index, @item it) {
case (ast.item_ty(?id, _, _, _, _)) {
index.insert(id, ast.mie_item(it));
}
case (ast.item_tag(?id, ?variants, _, _)) {
case (ast.item_tag(?id, ?variants, _, _, _)) {
index.insert(id, ast.mie_item(it));
let uint variant_idx = 0u;
for (ast.variant v in variants) {
@ -505,7 +505,7 @@ fn index_stmt(block_index index, @stmt s) {
case (ast.item_ty(?i, _, _, _, _)) {
index.insert(i, ast.bie_item(it));
}
case (ast.item_tag(?i, ?variants, _, _)) {
case (ast.item_tag(?i, ?variants, _, _, _)) {
index.insert(i, ast.bie_item(it));
let uint vid = 0u;
for (ast.variant v in variants) {

View file

@ -2071,7 +2071,8 @@ impure fn parse_item_tag(parser p) -> @ast.item {
p.bump();
auto hi = p.get_span();
auto item = ast.item_tag(id, variants, ty_params, p.next_def_id());
auto item = ast.item_tag(id, variants, ty_params, p.next_def_id(),
ast.ann_none);
ret @spanned(lo, hi, item);
}