Skip to content

Fix feature gate for repr(simd)#158523

Open
JonathanBrouwer wants to merge 1 commit into
rust-lang:mainfrom
JonathanBrouwer:repr_simd
Open

Fix feature gate for repr(simd)#158523
JonathanBrouwer wants to merge 1 commit into
rust-lang:mainfrom
JonathanBrouwer:repr_simd

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

The following code currently compiles on stable rust:

#[repr(simd)]
println!()

This has the following behavior:

  • 1.90 and earlier give an "unused attribute warning"
  • 1.91 ..= beta give no diagnostic output
  • nightly gives the following:
warning: `#[repr(simd)]` attribute cannot be used on macro calls
 --> src/main.rs:4:5
  |
4 |     #[repr(simd)]
  |     ^^^^^^^^^^^^^
  |
  = help: `#[repr(simd)]` can only be applied to structs
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: `#[warn(unused_attributes)]` (part of `#[warn(unused)]`) on by default

This PR changes this to a feature gate error.
r? @mejrs

@JonathanBrouwer JonathanBrouwer added needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. I-lang-nominated Nominated for discussion during a lang team meeting. S-waiting-on-t-lang Status: Awaiting decision from T-lang labels Jun 28, 2026
@rustbot

rustbot commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 28, 2026
@JonathanBrouwer JonathanBrouwer added the I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination label Jun 28, 2026

@mejrs mejrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please amend the PR description to state that this compiles without warning on rust 1.91 ..= current beta; this warning is only shown on nightly.

View changes since this review

Comment thread compiler/rustc_attr_parsing/src/attributes/repr.rs Outdated
@mejrs mejrs added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 28, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 28, 2026

@mejrs mejrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

r=me after lang decision

View changes since this review

@mejrs mejrs removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) I-lang-easy-decision Issue: The decision needed by the team is conjectured to be easy; this does not imply nomination I-lang-nominated Nominated for discussion during a lang team meeting. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-t-lang Status: Awaiting decision from T-lang T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants