-
Notifications
You must be signed in to change notification settings - Fork 13k
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
RFC: C99-style designated initializers #11936
Comments
What should be its syntax? We already have |
Don't forget unspecified elements need a default fill too in some applications (#12680). |
I was thinking something along the line of macro and / or compile time function evaluation (CTFE) may work but nothing concrete yet. |
This would need to go through the formal RFC process now. |
…l, r=llogiq Don't emit `struct_field_names` lint if all fields are booleans and don't start with the type's name Fixes rust-lang#11936. I only checked that all fields are booleans and not the prefix (nor the suffix) because when I started to list accepted prefixes (like "is", "has", "should", "could", etc), the list was starting to get a bit too long and I thought it was not really worth for such a small change. r? `@llogiq` changelog: Don't emit `struct_field_names` lint if all fields are booleans and don't start with the type's name
On several occasions I found myself in the need of C99-style designated initializer to initialize a static sparse array, like so:
It is just too error-prone, tedious and unsightly to type all remaining zeros. Note C99 designated initializer can also be applied to aggregate types but I doubt it would be as useful in rust.
The text was updated successfully, but these errors were encountered: