Skip to content

Commit 14c6c11

Browse files
committed
Add a semicolon to span for ast::Local
1 parent ed1cffd commit 14c6c11

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libsyntax/parse/parser.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -3671,12 +3671,17 @@ impl<'a> Parser<'a> {
36713671
None
36723672
};
36733673
let init = self.parse_initializer()?;
3674+
let hi = if self.token == token::Semi {
3675+
self.span
3676+
} else {
3677+
self.prev_span
3678+
};
36743679
Ok(P(ast::Local {
36753680
ty,
36763681
pat,
36773682
init,
36783683
id: ast::DUMMY_NODE_ID,
3679-
span: lo.to(self.prev_span),
3684+
span: lo.to(hi),
36803685
attrs,
36813686
}))
36823687
}

0 commit comments

Comments
 (0)