Skip to content

Commit a9f73b5

Browse files
huonwalexcrichton
authored andcommitted
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.
1 parent 6c52e72 commit a9f73b5

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/libsyntax/parse/obsolete.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pub enum ObsoleteSyntax {
3636
ObsoleteUnsafeExternFn,
3737
ObsoleteTraitFuncVisibility,
3838
ObsoleteConstPointer,
39-
ObsoleteEmptyImpl,
4039
ObsoleteLoopAsContinue,
4140
ObsoleteEnumWildcard,
4241
ObsoleteStructWildcard,
@@ -110,10 +109,6 @@ impl ParserObsoleteMethods for Parser {
110109
"instead of `&const Foo` or `@const Foo`, write `&Foo` or \
111110
`@Foo`"
112111
),
113-
ObsoleteEmptyImpl => (
114-
"empty implementation",
115-
"instead of `impl A;`, write `impl A {}`"
116-
),
117112
ObsoleteLoopAsContinue => (
118113
"`loop` instead of `continue`",
119114
"`loop` is now only used for loops and `continue` is used for \

src/libsyntax/parse/parser.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,21 +3926,15 @@ impl Parser {
39263926
};
39273927

39283928
let mut meths = ~[];
3929-
let inner_attrs = if self.eat(&token::SEMI) {
3930-
self.obsolete(self.last_span, ObsoleteEmptyImpl);
3931-
None
3932-
} else {
3933-
self.expect(&token::LBRACE);
3934-
let (inner_attrs, next) = self.parse_inner_attrs_and_next();
3935-
let mut method_attrs = Some(next);
3936-
while !self.eat(&token::RBRACE) {
3937-
meths.push(self.parse_method(method_attrs));
3938-
method_attrs = None;
3939-
}
3940-
Some(inner_attrs)
3941-
};
3929+
self.expect(&token::LBRACE);
3930+
let (inner_attrs, next) = self.parse_inner_attrs_and_next();
3931+
let mut method_attrs = Some(next);
3932+
while !self.eat(&token::RBRACE) {
3933+
meths.push(self.parse_method(method_attrs));
3934+
method_attrs = None;
3935+
}
39423936

3943-
(ident, ItemImpl(generics, opt_trait, ty, meths), inner_attrs)
3937+
(ident, ItemImpl(generics, opt_trait, ty, meths), Some(inner_attrs))
39443938
}
39453939

39463940
// parse a::B<~str,int>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
impl Foo; //~ ERROR expected `{` but found `;`

0 commit comments

Comments
 (0)