提交 14c6c119 编写于 作者: S Seiichi Uchida

Add a semicolon to span for ast::Local

上级 ed1cffdb
...@@ -3671,12 +3671,17 @@ fn parse_local(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Local>> { ...@@ -3671,12 +3671,17 @@ fn parse_local(&mut self, attrs: ThinVec<Attribute>) -> PResult<'a, P<Local>> {
None None
}; };
let init = self.parse_initializer()?; let init = self.parse_initializer()?;
let hi = if self.token == token::Semi {
self.span
} else {
self.prev_span
};
Ok(P(ast::Local { Ok(P(ast::Local {
ty, ty,
pat, pat,
init, init,
id: ast::DUMMY_NODE_ID, id: ast::DUMMY_NODE_ID,
span: lo.to(self.prev_span), span: lo.to(hi),
attrs, attrs,
})) }))
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册