about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-10-08 05:55:13 +0000
committerbors <bors@rust-lang.org>2017-10-08 05:55:13 +0000
commitf338dba29705e144bad8b2a675284538dd514896 (patch)
tree10480da46e8c7562ec48408dca191b6e8d9c7fa3 /src/libsyntax/parse
parent928a295718d252a908bffcbde747550510407a10 (diff)
parent7914e6fbc075f7f485fca4ab589563da4e95a9b7 (diff)
downloadrust-f338dba29705e144bad8b2a675284538dd514896.tar.gz
rust-f338dba29705e144bad8b2a675284538dd514896.zip
Auto merge of #45100 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests

- Successful merges: #45018, #45042, #45052, #45053, #45058, #45060, #45081, #45083, #45090, #45094
- Failed merges:
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs7
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,
         }))
     }