Remove the obsolete handler for impl A;.
This is has been obsolete for quite a while now (including a release), so removing the special handling seems fine. (The error message is quite good still anyway.) Fixes #9580.
This commit is contained in:
committed by
Alex Crichton
parent
6c52e72214
commit
a9f73b5e3d
@@ -36,7 +36,6 @@ pub enum ObsoleteSyntax {
|
||||
ObsoleteUnsafeExternFn,
|
||||
ObsoleteTraitFuncVisibility,
|
||||
ObsoleteConstPointer,
|
||||
ObsoleteEmptyImpl,
|
||||
ObsoleteLoopAsContinue,
|
||||
ObsoleteEnumWildcard,
|
||||
ObsoleteStructWildcard,
|
||||
@@ -110,10 +109,6 @@ impl ParserObsoleteMethods for Parser {
|
||||
"instead of `&const Foo` or `@const Foo`, write `&Foo` or \
|
||||
`@Foo`"
|
||||
),
|
||||
ObsoleteEmptyImpl => (
|
||||
"empty implementation",
|
||||
"instead of `impl A;`, write `impl A {}`"
|
||||
),
|
||||
ObsoleteLoopAsContinue => (
|
||||
"`loop` instead of `continue`",
|
||||
"`loop` is now only used for loops and `continue` is used for \
|
||||
|
||||
@@ -3926,21 +3926,15 @@ impl Parser {
|
||||
};
|
||||
|
||||
let mut meths = ~[];
|
||||
let inner_attrs = if self.eat(&token::SEMI) {
|
||||
self.obsolete(self.last_span, ObsoleteEmptyImpl);
|
||||
None
|
||||
} else {
|
||||
self.expect(&token::LBRACE);
|
||||
let (inner_attrs, next) = self.parse_inner_attrs_and_next();
|
||||
let mut method_attrs = Some(next);
|
||||
while !self.eat(&token::RBRACE) {
|
||||
meths.push(self.parse_method(method_attrs));
|
||||
method_attrs = None;
|
||||
}
|
||||
Some(inner_attrs)
|
||||
};
|
||||
self.expect(&token::LBRACE);
|
||||
let (inner_attrs, next) = self.parse_inner_attrs_and_next();
|
||||
let mut method_attrs = Some(next);
|
||||
while !self.eat(&token::RBRACE) {
|
||||
meths.push(self.parse_method(method_attrs));
|
||||
method_attrs = None;
|
||||
}
|
||||
|
||||
(ident, ItemImpl(generics, opt_trait, ty, meths), inner_attrs)
|
||||
(ident, ItemImpl(generics, opt_trait, ty, meths), Some(inner_attrs))
|
||||
}
|
||||
|
||||
// parse a::B<~str,int>
|
||||
|
||||
Reference in New Issue
Block a user