提交 48cb6af5 编写于 作者: K kennytm 提交者: GitHub

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

Add a semicolon to span for ast::Local
......@@ -3671,12 +3671,17 @@ fn parse_local(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Local>> {
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,
}))
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册