libsyntax: Stop parsing ~mut
This commit is contained in:
parent
e3d43e490b
commit
24893e8d02
@ -48,6 +48,7 @@ pub enum ObsoleteSyntax {
|
||||
ObsoleteUnenforcedBound,
|
||||
ObsoleteImplSyntax,
|
||||
ObsoleteTraitBoundSeparator,
|
||||
ObsoleteMutOwnedPointer,
|
||||
}
|
||||
|
||||
pub impl to_bytes::IterBytes for ObsoleteSyntax {
|
||||
@ -126,6 +127,12 @@ pub impl Parser {
|
||||
"space-separated trait bounds",
|
||||
"write `+` between trait bounds"
|
||||
),
|
||||
ObsoleteMutOwnedPointer => (
|
||||
"mutable owned pointer",
|
||||
"mutability inherits through `~` pointers; place the `~` box
|
||||
in a mutable location, like a mutable local variable or an \
|
||||
`@mut` box"
|
||||
),
|
||||
};
|
||||
|
||||
self.report(sp, kind, kind_str, desc);
|
||||
|
@ -75,7 +75,7 @@ use parse::obsolete::{ObsoleteMoveInit, ObsoleteBinaryMove};
|
||||
use parse::obsolete::{ObsoleteStructCtor, ObsoleteWith};
|
||||
use parse::obsolete::{ObsoleteSyntax, ObsoleteLowerCaseKindBounds};
|
||||
use parse::obsolete::{ObsoleteUnsafeBlock, ObsoleteImplSyntax};
|
||||
use parse::obsolete::{ObsoleteTraitBoundSeparator};
|
||||
use parse::obsolete::{ObsoleteTraitBoundSeparator, ObsoleteMutOwnedPointer};
|
||||
use parse::prec::{as_prec, token_to_binop};
|
||||
use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
|
||||
use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
|
||||
@ -677,6 +677,11 @@ pub impl Parser {
|
||||
// rather than boxed ptrs. But the special casing of str/vec is not
|
||||
// reflected in the AST type.
|
||||
let mt = self.parse_mt();
|
||||
|
||||
if mt.mutbl == m_mutbl && sigil == OwnedSigil {
|
||||
self.obsolete(*self.last_span, ObsoleteMutOwnedPointer);
|
||||
}
|
||||
|
||||
ctor(mt)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user