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

Correct spans for fields in enum struct arms ... #12854

Closed
wants to merge 1 commit into from

Conversation

nrc
Copy link
Member

@nrc nrc commented Mar 12, 2014

...where the field and variable are unified

@huonw
Copy link
Member

huonw commented Mar 12, 2014

This is a pattern like Foo { x }?

@nrc
Copy link
Member Author

nrc commented Mar 12, 2014

Yes, exactly

@flaper87
Copy link
Contributor

I hate being nitpicky on these things but. Would you mind making the commit title shorter and add a better description? It helps with keeping a good format in the history and prevents GH from doing what it did with this PR.

let subpat;
if self.token == token::COLON {

let subpat = if self.token == token::COLON {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use self.eat(token::COLON) and remove the self.bump()

eat bumps the token if present

@huonw
Copy link
Member

huonw commented Mar 13, 2014

+1 for better description. -1 on shorter title if it requires making it less sensible (good to strive for, but we don't have a hard requirement about it). +1 on a test (might be tricky though).

@nrc
Copy link
Member Author

nrc commented Mar 13, 2014

Yeah, I would like a test, but as you say it is tricky. It is caught by Rust/DXR's automated tests, which I would love to land someday...

@huonw
Copy link
Member

huonw commented Mar 13, 2014

Travis has a legitimate failure.

Correct spans for fields in enum struct arms where the field and variable are unified
@nrc
Copy link
Member Author

nrc commented Mar 19, 2014

Fixed the Travis error by reverting the change to use self.eat(token), since that breaks the error message for a misplaced colon.

bors added a commit that referenced this pull request Mar 20, 2014
...where the field and variable are unified
@bors bors closed this Mar 20, 2014
@nrc nrc deleted the parse-enum-struct branch March 25, 2014 06:14
fasterthanlime pushed a commit to fasterthanlime/rust that referenced this pull request Jul 24, 2022
fix generate_new doc

Looks like this got copied from `generate_impl` without adjusting the description.
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