diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-08-10 19:39:12 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-08-18 18:23:36 +0200 |
| commit | 59481823675a7392e8160b659b0f7fa119df60fd (patch) | |
| tree | 01405802c217ec5d3d8aa6c2dd9cd46e95c6fdda /src/libsyntax/parse/parser.rs | |
| parent | 7ac11cad3fe85163dd8b0ca1f63af492509f9bfe (diff) | |
| download | rust-59481823675a7392e8160b659b0f7fa119df60fd.tar.gz rust-59481823675a7392e8160b659b0f7fa119df60fd.zip | |
Add Span field for Generics structs
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 126e8816d05..19f44924067 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -716,8 +716,8 @@ impl<'a> Parser<'a> { let gt_str = Parser::token_to_string(&token::Gt); let this_token_str = self.this_token_to_string(); Err(self.fatal(&format!("expected `{}`, found `{}`", - gt_str, - this_token_str))) + gt_str, + this_token_str))) } } } @@ -4251,6 +4251,7 @@ impl<'a> Parser<'a> { /// where typaramseq = ( typaram ) | ( typaram , typaramseq ) pub fn parse_generics(&mut self) -> PResult<'a, ast::Generics> { maybe_whole!(self, NtGenerics); + let span_lo = self.span.lo; if self.eat(&token::Lt) { let lifetime_defs = self.parse_lifetime_defs()?; @@ -4273,7 +4274,8 @@ impl<'a> Parser<'a> { where_clause: WhereClause { id: ast::DUMMY_NODE_ID, predicates: Vec::new(), - } + }, + span: mk_sp(span_lo, self.last_span.hi), }) } else { Ok(ast::Generics::default()) |
