-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Comments
Yes, this is something that's changed, but the docs haven't. |
I would be happy to work with anyone who wants to work on this issue. |
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 |
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. |
I am not sure if this is the only file which requires the update. |
I don't believe so, or at least, not for this ticket. There's a lot of ways the reference can improve. |
Update on struct expressions Update doc for struct expressions (#32769)
Update on struct expressions Update doc for struct expressions (rust-lang#32769)
@steveklabnik Was this fixed by #34742? |
@steveklabnik I believe this was fixed by pr #34742. I see no inconsistencies in the book or reference. |
Closing! Thanks @apasel422 @achan1989 |
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.The text was updated successfully, but these errors were encountered: