Skip to content

Conversation

@lucasly-ba
Copy link
Contributor

@lucasly-ba lucasly-ba commented Oct 15, 2025

Fixes #4212

gcc/rust/ChangeLog:

* ast/rust-ast.cc (Attribute::is_derive): Change string derive to its definition.
* util/rust-attribute-values.h: Add attribute definition derive.
* util/rust-attributes.cc (AttributeChecker::visit): Add method check_inner_attributes. (AttributeChecker::check_inner_attributes): Check if there is a bad inner attribute.
* util/rust-attributes.h: Add method check_inner_attributes in .h.

gcc/testsuite/ChangeLog:

* rust/compile/issue-4212.rs: New test.

Signed-off-by: Lucas Ly Ba lucas.ly-ba@outlook.fr

gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Attribute::is_derive):
	Change string derive to its definition.
	* util/rust-attribute-values.h:
	Add attribute definition derive.
	* util/rust-attributes.cc (AttributeChecker::visit):
	Add method check_inner_attributes.
	(AttributeChecker::check_inner_attributes):
	Check if there is a bad inner attribute.
	* util/rust-attributes.h:
	Add method check_inner_attributes in .h.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-4212.rs: New test.

Signed-off-by: Lucas Ly Ba <lucas.ly-ba@outlook.fr>
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, this is perfect :) if you're interested please add the other forbidden crate level attributes in a separate PR. Thank you!!

@CohenArthur
Copy link
Member

Also, you can write "Fixes #4212" in the PR message and it'll automatically close the issue when we merge your PR. If you want to mention the issue in a commit message or in code, please write "Fixes #4212" as there are bots upstream that automatically link #<issue_number> to Bugzilla bug reports

@CohenArthur CohenArthur added this pull request to the merge queue Oct 16, 2025
Merged via the queue into Rust-GCC:master with commit cd72ca8 Oct 16, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

inner attribute derive doesn't show any errors

2 participants