summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-02-01 01:46:30 +1100
committerAlex Crichton <alex@alexcrichton.com>2014-01-31 21:43:09 -0800
commita9f73b5e3d947c3b8ef8c3a8fbd30823ba099886 (patch)
tree195a3188274e53ecb771dbcea7e6697fb21648af /src/libsyntax/parse
parent6c52e72214fbcebee4a216aefa8dea3ec3cacbdc (diff)
downloadrust-a9f73b5e3d947c3b8ef8c3a8fbd30823ba099886.tar.gz
rust-a9f73b5e3d947c3b8ef8c3a8fbd30823ba099886.zip
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.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/obsolete.rs5
-rw-r--r--src/libsyntax/parse/parser.rs22
2 files changed, 8 insertions, 19 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 6aa1afee206..c4887d55e2a 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -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 \
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 04a984ba95d..642624adfb2 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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>