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

reference.html inconsistent on struct expressions #32769

Closed
tromey opened this issue Apr 6, 2016 · 9 comments
Closed

reference.html inconsistent on struct expressions #32769

tromey opened this issue Apr 6, 2016 · 9 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@tromey
Copy link
Contributor

tromey commented Apr 6, 2016

One part of the reference manual says that empty braces are allowed for struct expressions: https://doc.rust-lang.org/reference.html#structs

Another part says that the braces must contain one or more initializers: https://doc.rust-lang.org/reference.html#struct-expressions

rustc tells me that empty braces are an unstable extension, so one way to resolve the discrepancy would be to mention this in the manual, preferably at both spots.

@steveklabnik
Copy link
Member

Yes, this is something that's changed, but the docs haven't.

@steveklabnik steveklabnik added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Jun 27, 2016
@steveklabnik
Copy link
Member

I would be happy to work with anyone who wants to work on this issue.

@steveklabnik steveklabnik added the E-help-wanted Call for participation: Help is requested to fix this issue. label Jun 27, 2016
@abhijeetbhagat
Copy link
Contributor

I can work on this. The latest compiler doesn't seem to give any kind of a warning related to empty braces - https://is.gd/h7oleb

@steveklabnik
Copy link
Member

That'd be great! Since the time this issue was filed, braces are okay to use in stable. So these spots should be updated to reflect that.

@abhijeetbhagat
Copy link
Contributor

I am not sure if this is the only file which requires the update.

@steveklabnik
Copy link
Member

I don't believe so, or at least, not for this ticket. There's a lot of ways the reference can improve.

bors added a commit that referenced this issue Jul 11, 2016
Update on struct expressions

Update doc for struct expressions (#32769)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jul 12, 2016
Update on struct expressions

Update doc for struct expressions (rust-lang#32769)
@apasel422
Copy link
Contributor

@steveklabnik Was this fixed by #34742?

@achan1989
Copy link
Contributor

@steveklabnik I believe this was fixed by pr #34742. I see no inconsistencies in the book or reference.

@steveklabnik
Copy link
Member

Closing! Thanks @apasel422 @achan1989

dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

5 participants