-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
default_field_values grammar #18938
Comments
Dropping some pointers here (for anyone interested, no need to do all of this at once, just the parsing part on its own for now is fine) So the parser needs to be adjusted as follows:
The trickier part is that all fields now become potential bodies which still kind of struggle to represent properly, generally we'd need to add a new variant to rust-analyzer/crates/hir-def/src/lib.rs Lines 875 to 883 in 40710f2
FieldId(FieldId) . Then the compiler should guide you through most changes required.
Adjust the default derive rust-analyzer/crates/hir-expand/src/builtin/derive_macro.rs Lines 594 to 635 in 40710f2
|
Allow struct definitions to provide default values for individual fields and thereby allowing those to be omitted from initializers.
https://rust-lang.github.io/rfcs/3681-default-field-values.html
dtolnay/syn#1774
The text was updated successfully, but these errors were encountered: