Skip to content
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

Merged
merged 1 commit into from
Jul 26, 2017
Merged

Conversation

nrc
Copy link
Member

@nrc nrc commented Jul 24, 2017

No description provided.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@petrochenkov
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jul 25, 2017

📌 Commit 5388470 has been approved by petrochenkov

@@ -2243,9 +2243,9 @@ impl<'a> Parser<'a> {
attrs);
}
if self.is_catch_expr() {
let lo = self.span;
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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.

Copy link
Contributor

@nikomatsakis nikomatsakis left a 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.

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 26, 2017
Fix the spans of catch blocks to include the `do`
bors added a commit that referenced this pull request Jul 26, 2017
Rollup of 10 pull requests

- Successful merges: #42959, #43447, #43455, #43456, #43458, #43462, #43463, #43465, #43471, #43480
- Failed merges:
@bors bors merged commit 5388470 into rust-lang:master Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants