rustc: When encountering "mutable" as a tycon, parse it, drop it on the floor, and emit a warning
This commit is contained in:
@@ -40,6 +40,14 @@ obj session(cfg targ) {
|
|||||||
fail;
|
fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn span_warn(span sp, str msg) {
|
||||||
|
log #fmt("%s:%u:%u:%u:%u: warning: %s",
|
||||||
|
sp.filename,
|
||||||
|
sp.lo.line, sp.lo.col,
|
||||||
|
sp.hi.line, sp.hi.col,
|
||||||
|
msg);
|
||||||
|
}
|
||||||
|
|
||||||
fn bug(str msg) {
|
fn bug(str msg) {
|
||||||
log #fmt("error: internal compiler error %s", msg);
|
log #fmt("error: internal compiler error %s", msg);
|
||||||
fail;
|
fail;
|
||||||
|
|||||||
@@ -452,6 +452,15 @@ impure fn parse_ty(parser p) -> @ast.ty {
|
|||||||
t = ast.ty_path(parse_path(p, GREEDY), none[ast.def]);
|
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 (_) {
|
case (_) {
|
||||||
p.err("expecting type");
|
p.err("expecting type");
|
||||||
t = ast.ty_nil;
|
t = ast.ty_nil;
|
||||||
|
|||||||
Reference in New Issue
Block a user