Rollup merge of #45060 - topecongiro:semi-in-local-span, r=petrochenkov

Add a semicolon to span for ast::Local
This commit is contained in:
kennytm 2017-10-08 13:39:02 +08:00 committed by GitHub
commit 48cb6af50b

View File

@ -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,
}))
}