Skip to content

StructField span should include pub #26084

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

Closed
wants to merge 2 commits into from

Conversation

chellmuth
Copy link
Contributor

Issue: #26083

I could use help creating a test for this change.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@nrc
Copy link
Member

nrc commented Jun 7, 2015

There's no great way to test these span bugs, which is why they keep cropping up. You can do something specific if you can find an error which gives the whole field as the span in the error message then you can write a test like:

struct Foo {
    pub
    foo: T,
}

And test that you get the error on the line with pub (to be thorough, you need to have this kind of test for each part of the span you're testing). I don't recall the details of how the error checking works though, you might need to experiment.

Anyway, usually we just don't bother ( :-( )

@nrc
Copy link
Member

nrc commented Jun 7, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 7, 2015

📌 Commit a722838 has been approved by nrc

@bors
Copy link
Collaborator

bors commented Jun 7, 2015

⌛ Testing commit a722838 with merge d4c0cea...

@chellmuth
Copy link
Contributor Author

Ah, the line break is a clever solution. I was disappointed that you couldn't use //~^ in a white-space sensitive way and align it under where the error should occur.

How does this test look?

@nrc
Copy link
Member

nrc commented Jun 8, 2015

Test looks good, modulo nits. Could you submit as a new PR please? bors is already testing this one.

@chellmuth
Copy link
Contributor Author

Re-submitted as #26091

@nrc nrc closed this Jun 8, 2015
bors added a commit that referenced this pull request Jun 8, 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.

5 participants