diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-28 10:30:01 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-08-28 10:30:08 +0000 |
| commit | b833e8d0a0f964b5e4708531ab579ef5454a5066 (patch) | |
| tree | c3580a2ac32905509d74dcaa43ba62e5fb85b5e1 /src/libsyntax/parse/parser.rs | |
| parent | aa05a153630b64a6928128dae333714c0814c4ca (diff) | |
| parent | 59481823675a7392e8160b659b0f7fa119df60fd (diff) | |
| download | rust-b833e8d0a0f964b5e4708531ab579ef5454a5066.tar.gz rust-b833e8d0a0f964b5e4708531ab579ef5454a5066.zip | |
Rollup merge of #35591 - GuillaumeGomez:generics_span, r=jntrmr
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 1646246069e..5b710882219 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -725,8 +725,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))) } } } @@ -4293,6 +4293,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()?; @@ -4315,7 +4316,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()) |
