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

Add outer attributes to struct expr fields #3017

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

P-E-P
Copy link
Member

@P-E-P P-E-P commented May 20, 2024

Struct fields can have outer attributes on their field for various purpose, this behavior should be reflected upon struct expr fields.

Fixes #3018

@P-E-P P-E-P requested a review from CohenArthur May 20, 2024 13:42
@P-E-P P-E-P self-assigned this May 20, 2024
Struct fields can have outer attributes on their field for various
purpose, this behavior should be reflected upon struct expr fields.

gcc/rust/ChangeLog:

	* ast/rust-ast-collector.cc (TokenCollector::visit): Output field
	attributes.
	* ast/rust-expr.h (class StructExprField): Add outer attributes member.
	* parse/rust-parse-impl.h (Parser::parse_struct_expr_field): Parse
	outer attributes and store them in the appropriate AST node.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
We want to prevent regressions on struct expr field attribute parsing.

gcc/testsuite/ChangeLog:

	* rust/compile/struct_expr_field_attributes.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
@P-E-P P-E-P marked this pull request as ready for review May 22, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Cannot parse StructExprField attributes
1 participant