Skip to content

Commit 98eb5f7

Browse files
committed
auto merge of #15428 : phildawes/rust/master, r=huonw
Fix small bug introduced in e38cb97: PatIdent span was incorrect because self.last_span was being used before the ident token was parsed.
2 parents c8bbba9 + 9deeaef commit 98eb5f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,8 +3118,9 @@ impl<'a> Parser<'a> {
31183118
self.span_fatal(last_span,
31193119
"expected identifier, found path");
31203120
}
3121-
// why a path here, and not just an identifier?
3122-
let name = codemap::Spanned{span: self.last_span, node: self.parse_ident()};
3121+
let ident = self.parse_ident();
3122+
let last_span = self.last_span;
3123+
let name = codemap::Spanned{span: last_span, node: ident};
31233124
let sub = if self.eat(&token::AT) {
31243125
Some(self.parse_pat())
31253126
} else {

0 commit comments

Comments
 (0)