diff options
| author | Patrick Walton <[email protected]> | 2011-03-31 19:12:40 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-31 19:12:40 -0700 |
| commit | c66edca83d04c5be5c27629b43c2c180a67f2d63 (patch) | |
| tree | 37db28b65567fd8c067c82d1917878181a69c0f5 /src/comp/front | |
| parent | rustc: Make tag_ty_params() and substitute_ty_params() take def ids instead o... (diff) | |
| download | rust-c66edca83d04c5be5c27629b43c2c180a67f2d63.tar.xz rust-c66edca83d04c5be5c27629b43c2c180a67f2d63.zip | |
rustc: Add a type annotation to tag items
Diffstat (limited to 'src/comp/front')
| -rw-r--r-- | src/comp/front/ast.rs | 6 | ||||
| -rw-r--r-- | src/comp/front/parser.rs | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index fae90392..0bd18382 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -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) { diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index e0324f77..f7d355a4 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -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); } |