about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-07-11 12:57:05 -0700
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2017-07-28 15:46:26 +0200
commit09a5d319ab8fbfd43530289bfff3899f9035e37f (patch)
tree663406df0155f3a95cbdc573aefb7b7cc7b5c5e5 /src/libsyntax
parent93172045c817ffa998d5e28a0899f33edf889f62 (diff)
downloadrust-09a5d319ab8fbfd43530289bfff3899f9035e37f.tar.gz
rust-09a5d319ab8fbfd43530289bfff3899f9035e37f.zip
Remove support for `gen arg`
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs3
-rw-r--r--src/libsyntax/feature_gate.rs5
-rw-r--r--src/libsyntax/fold.rs1
-rw-r--r--src/libsyntax/parse/parser.rs14
-rw-r--r--src/libsyntax/print/pprust.rs3
-rw-r--r--src/libsyntax/visit.rs1
6 files changed, 1 insertions, 26 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 1a2299bcf1f..0128bf73a35 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -984,9 +984,6 @@ pub enum ExprKind {
 
     /// A `yield`, with an optional value to be yielded
     Yield(Option<P<Expr>>),
-
-    /// A reference to the implicit argument of a generator
-    ImplArg,
 }
 
 /// The explicit Self type in a "qualified path". The actual
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 0f99761968a..bf19a7e0383 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -1335,11 +1335,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                                   e.span,
                                   "yield syntax is experimental");
             }
-            ast::ExprKind::ImplArg => {
-                gate_feature_post!(&self, generators,
-                                  e.span,
-                                  "gen arg syntax is experimental");
-            }
             ast::ExprKind::Lit(ref lit) => {
                 if let ast::LitKind::Int(_, ref ty) = lit.node {
                     match *ty {
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index 4a86008bb33..580c2aa58a5 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -1304,7 +1304,6 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span, attrs}: Expr, folder: &mu
                 };
             }
             ExprKind::Yield(ex) => ExprKind::Yield(ex.map(|x| folder.fold_expr(x))),
-            ExprKind::ImplArg => ExprKind::ImplArg,
             ExprKind::Try(ex) => ExprKind::Try(folder.fold_expr(ex)),
             ExprKind::Catch(body) => ExprKind::Catch(folder.fold_block(body)),
         },
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 6b825a9d401..b7ae025db5f 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2146,12 +2146,6 @@ impl<'a> Parser<'a> {
                     assert!(self.eat_keyword(keywords::Catch));
                     return self.parse_catch_expr(lo, attrs);
                 }
-                if self.is_gen_arg() {
-                    assert!(self.eat_keyword(keywords::Gen));
-                    assert!(self.eat_keyword(keywords::Arg));
-                    let hi = self.prev_span;
-                    return Ok(self.mk_expr(lo.to(hi), ExprKind::ImplArg, attrs));
-                }
                 if self.eat_keyword(keywords::Return) {
                     if self.token.can_begin_expr() {
                         let e = self.parse_expr()?;
@@ -3710,11 +3704,6 @@ impl<'a> Parser<'a> {
         self.look_ahead(1, |t| t.is_ident() && !t.is_reserved_ident())
     }
 
-    fn is_gen_arg(&self) -> bool {
-        self.token.is_keyword(keywords::Gen) &&
-        self.look_ahead(1, |t| t.is_keyword(keywords::Arg))
-    }
-
     fn is_defaultness(&self) -> bool {
         // `pub` is included for better error messages
         self.token.is_keyword(keywords::Default) &&
@@ -3818,8 +3807,7 @@ impl<'a> Parser<'a> {
         // Starts like a simple path, but not a union item.
         } else if self.token.is_path_start() &&
                   !self.token.is_qpath_start() &&
-                  !self.is_union_item() &&
-                  !self.is_gen_arg() {
+                  !self.is_union_item() {
             let pth = self.parse_path(PathStyle::Expr)?;
 
             if !self.eat(&token::Not) {
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 1412f78b00d..9e36fb83696 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -2290,9 +2290,6 @@ impl<'a> State<'a> {
                     _ => ()
                 }
             }
-            ast::ExprKind::ImplArg => {
-                self.s.word("impl arg")?;
-            }
             ast::ExprKind::Try(ref e) => {
                 self.print_expr(e)?;
                 self.s.word("?")?
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index cd8a2f1534b..05077d42a0b 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -787,7 +787,6 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
         ExprKind::Yield(ref optional_expression) => {
             walk_list!(visitor, visit_expr, optional_expression);
         }
-        ExprKind::ImplArg => (),
         ExprKind::Try(ref subexpression) => {
             visitor.visit_expr(subexpression)
         }