提交 98eb5f74 编写于 作者: B bors

auto merge of #15428 : phildawes/rust/master, r=huonw

Fix small bug introduced in e38cb972: PatIdent span was incorrect
because self.last_span was being used before the ident token was
parsed.
......@@ -3118,8 +3118,9 @@ fn parse_pat_ident(&mut self,
self.span_fatal(last_span,
"expected identifier, found path");
}
// why a path here, and not just an identifier?
let name = codemap::Spanned{span: self.last_span, node: self.parse_ident()};
let ident = self.parse_ident();
let last_span = self.last_span;
let name = codemap::Spanned{span: last_span, node: ident};
let sub = if self.eat(&token::AT) {
Some(self.parse_pat())
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册