Skip to content

Conversation

@Pasta-coder
Copy link
Contributor

Fixes #4233

Emit a diagnostic when #[target_feature] is used without arguments,
matching rustc behavior.

  • Add testsuite case asserting the diagnostic
  • Validate attribute input in AttributeChec

@Pasta-coder Pasta-coder force-pushed the fix/target-feature-malformed-4233-clean branch 12 times, most recently from 679e3ef to 1689757 Compare January 3, 2026 22:24
@Pasta-coder Pasta-coder changed the title Fix/target feature malformed 4233 util/attributes: Fix/target feature malformed 4233 Jan 6, 2026
@Pasta-coder Pasta-coder marked this pull request as draft January 6, 2026 13:27
@Pasta-coder Pasta-coder force-pushed the fix/target-feature-malformed-4233-clean branch from 6b3d4a1 to 0ca7bc0 Compare January 6, 2026 16:26
Emit a diagnostic when #[target_feature] is used without arguments,
matching rustc behavior. This prevents silent acceptance of empty
attributes and provides a helpful diagnostic that shows the expected form.

Fixes Rust-GCC#4233

gcc/rust/ChangeLog:

	* util/rust-attributes.cc (AttributeChecker::visit): Emit diagnostic.

gcc/testsuite/ChangeLog:

	* rust/compile/target_feature-malformed-4233.rs: New test.

Signed-off-by: Jayant Chauhan <[email protected]>
@Pasta-coder Pasta-coder force-pushed the fix/target-feature-malformed-4233-clean branch from 0ca7bc0 to a6e7b02 Compare January 6, 2026 16:27
@Pasta-coder Pasta-coder marked this pull request as ready for review January 6, 2026 17:17
@Pasta-coder
Copy link
Contributor Author

@P-E-P please review

thankyou .

@P-E-P P-E-P added this pull request to the merge queue Jan 7, 2026
Merged via the queue into Rust-GCC:master with commit d63a4c3 Jan 7, 2026
12 checks passed
@Pasta-coder Pasta-coder deleted the fix/target-feature-malformed-4233-clean branch January 7, 2026 21:15
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.

malformed target_feature attribute input should give error

2 participants