From f977bedafd657b52fb618cc788cc31f35336270d Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 18 Nov 2013 18:25:25 -0800 Subject: libsyntax: Remove `~fn()` from the language --- src/libsyntax/parse/parser.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse/parser.rs') 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); } } -- cgit 1.4.1-3-g733a5