-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the spans of catch blocks to include the do
#43463
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
📌 Commit 5388470 has been approved by |
@@ -2243,9 +2243,9 @@ impl<'a> Parser<'a> { | |||
attrs); | |||
} | |||
if self.is_catch_expr() { | |||
let lo = self.span; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this come after self.eat_keyword(keywords::Do)
instead of before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed from using prev_span
to span
, so we can move it before the eat(Do) expression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I missed the change. Thank you for your reply, and sorry for the noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with a test; the most straightforward thing would be to add a src/test/ui
test that has incorrect highlighting with the current span.
Fix the spans of catch blocks to include the `do`
No description provided.