libsyntax: Make managed box @ patterns obsolete
This commit is contained in:
parent
b8c60f906b
commit
ce358fca33
2 changed files with 12 additions and 3 deletions
|
|
@ -44,7 +44,8 @@ pub enum ObsoleteSyntax {
|
|||
ObsoleteBoxedClosure,
|
||||
ObsoleteClosureType,
|
||||
ObsoleteMultipleImport,
|
||||
ObsoleteExternModAttributesInParens
|
||||
ObsoleteExternModAttributesInParens,
|
||||
ObsoleteManagedPattern,
|
||||
}
|
||||
|
||||
impl to_bytes::IterBytes for ObsoleteSyntax {
|
||||
|
|
@ -148,7 +149,12 @@ impl ParserObsoleteMethods for Parser {
|
|||
"`extern mod` with linkage attribute list",
|
||||
"use `extern mod foo = \"bar\";` instead of \
|
||||
`extern mod foo (name = \"bar\")`"
|
||||
)
|
||||
),
|
||||
ObsoleteManagedPattern => (
|
||||
"managed pointer pattern",
|
||||
"use a nested `match` expression instead of a managed box \
|
||||
pattern"
|
||||
),
|
||||
};
|
||||
|
||||
self.report(sp, kind, kind_str, desc);
|
||||
|
|
|
|||
|
|
@ -2903,7 +2903,10 @@ impl Parser {
|
|||
};
|
||||
PatLit(vst)
|
||||
}
|
||||
_ => PatBox(sub)
|
||||
_ => {
|
||||
self.obsolete(self.span, ObsoleteManagedPattern);
|
||||
PatBox(sub)
|
||||
}
|
||||
};
|
||||
hi = self.last_span.hi;
|
||||
return @ast::Pat {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue