Skip to content

Commit 1f5dc55

Browse files
committed
Correct span for ExprCall and ExprIndex
1 parent 77eedda commit 1f5dc55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,7 +2025,7 @@ impl Parser {
20252025
seq_sep_trailing_disallowed(token::COMMA),
20262026
|p| p.parse_expr()
20272027
);
2028-
hi = self.span.hi;
2028+
hi = self.last_span.hi;
20292029

20302030
let nd = self.mk_call(e, es, NoSugar);
20312031
e = self.mk_expr(lo, hi, nd);
@@ -2035,7 +2035,7 @@ impl Parser {
20352035
token::LBRACKET => {
20362036
self.bump();
20372037
let ix = self.parse_expr();
2038-
hi = ix.span.hi;
2038+
hi = self.span.hi;
20392039
self.commit_expr_expecting(ix, token::RBRACKET);
20402040
let index = self.mk_index(e, ix);
20412041
e = self.mk_expr(lo, hi, index)

0 commit comments

Comments
 (0)