pub enum ObsoleteSyntax {
ObsoleteLet,
ObsoleteFieldTerminator,
- ObsoleteStructCtor,
ObsoleteWith,
ObsoleteClassTraits,
ObsoletePrivSection,
fn token_is_obsolete_ident(&self, ident: &str, token: &Token) -> bool;
fn is_obsolete_ident(&self, ident: &str) -> bool;
fn eat_obsolete_ident(&self, ident: &str) -> bool;
- fn try_parse_obsolete_struct_ctor(&self) -> bool;
fn try_parse_obsolete_with(&self) -> bool;
fn try_parse_obsolete_priv_section(&self, attrs: &[Attribute]) -> bool;
}
"field declaration terminated with semicolon",
"fields are now separated by commas"
),
- ObsoleteStructCtor => (
- "struct constructor",
- "structs are now constructed with `MyStruct { foo: val }` \
- syntax. Structs with private fields cannot be created \
- outside of their defining module"
- ),
ObsoleteWith => (
"with",
"record update is done with `..`, e.g. \
}
}
- fn try_parse_obsolete_struct_ctor(&self) -> bool {
- if self.eat_obsolete_ident("new") {
- self.obsolete(*self.last_span, ObsoleteStructCtor);
- self.parse_fn_decl();
- self.parse_block();
- true
- } else {
- false
- }
- }
-
fn try_parse_obsolete_with(&self) -> bool {
if *self.token == token::COMMA
&& self.look_ahead(1,