Skip to content

Commit 616e53f

Browse files
committed
auto merge of #12181 : sanxiyn/rust/accurate-span-4, r=alexcrichton
2 parents 5b5ebf2 + f3b5ec2 commit 616e53f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ impl Parser {
17991799
} else if self.eat_keyword(keywords::Self) {
18001800
let path = ast_util::ident_to_path(mk_sp(lo, hi), special_idents::self_);
18011801
ex = ExprPath(path);
1802-
hi = self.span.hi;
1802+
hi = self.last_span.hi;
18031803
} else if self.eat_keyword(keywords::If) {
18041804
return self.parse_if_expr();
18051805
} else if self.eat_keyword(keywords::For) {
@@ -1934,7 +1934,7 @@ impl Parser {
19341934
&[token::COMMA], &[token::RBRACE]);
19351935
}
19361936

1937-
hi = pth.span.hi;
1937+
hi = self.span.hi;
19381938
self.expect(&token::RBRACE);
19391939
ex = ExprStruct(pth, fields, base);
19401940
return self.mk_expr(lo, hi, ex);

0 commit comments

Comments
 (0)