mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-22 21:44:44 +00:00
Rollup merge of #45060 - topecongiro:semi-in-local-span, r=petrochenkov
Add a semicolon to span for ast::Local
This commit is contained in:
commit
48cb6af50b
@ -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,
|
||||
}))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user