Skip to content

Fix spans for continues and breaks #28117

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

Merged
merged 1 commit into from
Sep 2, 2015
Merged

Fix spans for continues and breaks #28117

merged 1 commit into from
Sep 2, 2015

Conversation

marcusklaas
Copy link
Contributor

Fixes #28108.

@rust-highfive
Copy link
Contributor

r? @brson

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

@alexcrichton
Copy link
Member

Was the modified test broken by this change? It looks like that should probably still be passing?

@marcusklaas
Copy link
Contributor Author

It still passes now, but may not be very future-proof: #28106 (comment)

@alexcrichton
Copy link
Member

Could this leave around the test for now and just add a new one for the spans?

@marcusklaas
Copy link
Contributor Author

The new test does the exact same thing as the old one. There's no test for the new changes AFAIK, as the spans have shrunk.

@brson
Copy link
Contributor

brson commented Aug 31, 2015

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned brson Aug 31, 2015
@alexcrichton
Copy link
Member

Although these may hit the same code path they're testing two distinct things:

  1. The span of an unknown label
  2. The span of a break/loop outside a loop

In general it's better to err on the side of more tests basically, so could this just add a new test instead of modifying an existing one?

@marcusklaas
Copy link
Contributor Author

The test's original intention was never to check the span of the label, but to make sure that the keywords were included in the span: #28106
As you and @nagisa correctly note, this isn't what was actually tested, hence the change.

The changes to parser.rs and the test are unrelated and I now realize I should've just created separate PRs for them. Shall I do that after all?

@nagisa
Copy link
Member

nagisa commented Sep 1, 2015

@alexcrichton I approve that test change, if that means anything. For all its worth the labels thing has its own issue: #28109, therefore the labels should eventually get a test for them anyway.

@alexcrichton
Copy link
Member

Can you please leave the test case as is? #28105 is a legit issue and #28108 should get its own test case as well.

The spans of break and continue would include the next token.
@marcusklaas
Copy link
Contributor Author

Reverted test, although I still believe that there is a misunderstanding here.

@alexcrichton
Copy link
Member

@bors: r+ 3a360fc

bors added a commit that referenced this pull request Sep 2, 2015
@bors
Copy link
Collaborator

bors commented Sep 2, 2015

⌛ Testing commit 3a360fc with merge b7b1dce...

@bors bors merged commit 3a360fc into rust-lang:master Sep 2, 2015
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