rustc: When encountering "mutable" as a tycon, parse it, drop it on the floor, and emit a warning

This commit is contained in:
Patrick Walton
2011-03-18 13:44:13 -07:00
parent 8aa946ff5e
commit 8b82a549bf
2 changed files with 17 additions and 0 deletions

View File

@@ -452,6 +452,15 @@ impure fn parse_ty(parser p) -> @ast.ty {
t = ast.ty_path(parse_path(p, GREEDY), none[ast.def]);
}
case (token.MUTABLE) {
p.bump();
p.get_session().span_warn(p.get_span(),
"ignoring deprecated 'mutable' type constructor");
auto typ = parse_ty(p);
t = typ.node;
hi = typ.span;
}
case (_) {
p.err("expecting type");
t = ast.ty_nil;