mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
libsyntax: Make managed box @
patterns obsolete
This commit is contained in:
parent
b8c60f906b
commit
ce358fca33
@ -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…
Reference in New Issue
Block a user