From 74d11d26f4042ce04c56edfd6caafa003383147d Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Wed, 31 Dec 2014 17:24:42 +1300 Subject: Accept `self` in place of `mod` in use items [breaking-change] `mod` is still accepted, but gives a deprecated warning --- src/libsyntax/parse/parser.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 457085f5cc8..f84ddcf360e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -546,6 +546,10 @@ impl<'a> Parser<'a> { pub fn parse_path_list_item(&mut self) -> ast::PathListItem { let lo = self.span.lo; let node = if self.eat_keyword(keywords::Mod) { + let span = self.last_span; + self.span_warn(span, "deprecated syntax; use the `self` keyword now"); + ast::PathListMod { id: ast::DUMMY_NODE_ID } + } else if self.eat_keyword(keywords::Self) { ast::PathListMod { id: ast::DUMMY_NODE_ID } } else { let ident = self.parse_ident(); -- cgit 1.4.1-3-g733a5