diff options
| author | Seiichi Uchida <seuchida@gmail.com> | 2017-10-06 19:16:16 +0900 |
|---|---|---|
| committer | Seiichi Uchida <seuchida@gmail.com> | 2017-10-06 19:17:40 +0900 |
| commit | 14c6c119042d2cfbaea0e17e47d2c160261e73ab (patch) | |
| tree | 61489ba2fea1c2af6dbd45e0668cb1b10b91763e /src/libsyntax/parse/parser.rs | |
| parent | ed1cffdb21220f633b8b91f099a69fab4ef2b8f4 (diff) | |
| download | rust-14c6c119042d2cfbaea0e17e47d2c160261e73ab.tar.gz rust-14c6c119042d2cfbaea0e17e47d2c160261e73ab.zip | |
Add a semicolon to span for ast::Local
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 65dabe98a06..978e06c75dd 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3671,12 +3671,17 @@ impl<'a> Parser<'a> { None }; let init = self.parse_initializer()?; + let hi = if self.token == token::Semi { + self.span + } else { + self.prev_span + }; Ok(P(ast::Local { ty, pat, init, id: ast::DUMMY_NODE_ID, - span: lo.to(self.prev_span), + span: lo.to(hi), attrs, })) } |
