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

Merged
merged 2 commits into from
Jun 12, 2024

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 <pierre-emmanuel.patry@embecosm.com>
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 <pierre-emmanuel.patry@embecosm.com>
@P-E-P P-E-P marked this pull request as ready for review May 22, 2024 16:07
@P-E-P P-E-P added this pull request to the merge queue Jun 12, 2024
Merged via the queue into Rust-GCC:master with commit 53a857a Jun 12, 2024
9 checks passed
@CohenArthur CohenArthur added this to the cfg-core milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cannot parse StructExprField attributes
2 participants