about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-01-13 19:26:49 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-01-13 19:26:49 +0300
commit22598776b04cc947f001191b47c18d981b46eec7 (patch)
tree10957127d28e9ccef3d2c793a9f968f8b2f30828 /src/libsyntax/parse
parent8b4d852f32b6bf3fdec2cce6c0d2804b27d02a20 (diff)
downloadrust-22598776b04cc947f001191b47c18d981b46eec7.tar.gz
rust-22598776b04cc947f001191b47c18d981b46eec7.zip
Re-add support for `impl Trait for ..` to the parser
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index ce42b05b8bb..ad9c802ac85 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -5422,7 +5422,11 @@ impl<'a> Parser<'a> {
         };
 
         if opt_trait.is_some() {
-            ty = self.parse_ty()?;
+            ty = if self.eat(&token::DotDot) {
+                P(Ty { node: TyKind::Err, span: self.prev_span, id: ast::DUMMY_NODE_ID })
+            } else {
+                self.parse_ty()?
+            }
         }
         generics.where_clause = self.parse_where_clause()?;