From 319d778ed306d0b3c35af79c47c702dbdebf6d09 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Tue, 28 Oct 2014 14:48:52 -0400 Subject: Restructure AST so that the associated type definition carries bounds like any other "type parameter". --- src/libsyntax/parse/parser.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index aa3b9668d46..ad445ef331f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1229,16 +1229,13 @@ impl<'a> Parser<'a> { /// Parses `type Foo;` in a trait declaration only. The `type` keyword has /// already been parsed. fn parse_associated_type(&mut self, attrs: Vec) - -> AssociatedType { - let lo = self.span.lo; - let ident = self.parse_ident(); - let hi = self.span.hi; + -> AssociatedType + { + let ty_param = self.parse_ty_param(); self.expect(&token::Semi); AssociatedType { - id: ast::DUMMY_NODE_ID, - span: mk_sp(lo, hi), - ident: ident, attrs: attrs, + ty_param: ty_param, } } -- cgit 1.4.1-3-g733a5