about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-11-18 18:25:25 -0800
committerPatrick Walton <pcwalton@mimiga.net>2013-11-18 18:28:10 -0800
commitf977bedafd657b52fb618cc788cc31f35336270d (patch)
tree33456b9dc3f2b7a6f5cc07aecf30aa9951242ac3 /src/libsyntax/parse/parser.rs
parentba739b2135f794dd2f1cff3c82cf9282cc1d50cb (diff)
downloadrust-f977bedafd657b52fb618cc788cc31f35336270d.tar.gz
rust-f977bedafd657b52fb618cc788cc31f35336270d.zip
libsyntax: Remove `~fn()` from the language
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 1b2e18f3ca5..2ea6878f4a3 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1273,15 +1273,17 @@ impl Parser {
     pub fn parse_box_or_uniq_pointee(&self,
                                      sigil: ast::Sigil,
                                      ctor: &fn(v: mt) -> ty_) -> ty_ {
-        // ~'foo fn() or ~fn() are parsed directly as fn types:
+        // ~'foo fn() or ~fn() are parsed directly as obsolete fn types:
         match *self.token {
             token::LIFETIME(*) => {
                 let lifetime = self.parse_lifetime();
+                self.obsolete(*self.last_span, ObsoleteBoxedClosure);
                 return self.parse_ty_closure(Some(sigil), Some(lifetime));
             }
 
-            token::IDENT(*) => {
+            token::IDENT(*) if sigil == ast::BorrowedSigil => {
                 if self.token_is_old_style_closure_keyword() {
+                    self.obsolete(*self.last_span, ObsoleteBoxedClosure);
                     return self.parse_ty_closure(Some(sigil), None);
                 }
             }