Skip to content

stabilize feature(cfg_target_has_atomic_equal_alignment)#155006

Open
WaffleLapkin wants to merge 1 commit intorust-lang:mainfrom
WaffleLapkin:stabilize_cfg_target_has_atomic_equal_alignment
Open

stabilize feature(cfg_target_has_atomic_equal_alignment)#155006
WaffleLapkin wants to merge 1 commit intorust-lang:mainfrom
WaffleLapkin:stabilize_cfg_target_has_atomic_equal_alignment

Conversation

@WaffleLapkin
Copy link
Copy Markdown
Member

See stabilization report: #93822 (comment)
cc @joshtriplett

@rustbot rustbot added 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 8, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 8, 2026

r? @mati865

rustbot has assigned @mati865.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 12 candidates

@WaffleLapkin WaffleLapkin force-pushed the stabilize_cfg_target_has_atomic_equal_alignment branch from 683bcac to e4bd7a8 Compare April 9, 2026 13:52
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@traviscross traviscross added T-lang Relevant to the language team 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. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels Apr 10, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 12, 2026

☔ The latest upstream changes (presumably #155175) made this pull request unmergeable. Please resolve the merge conflicts.

@WaffleLapkin WaffleLapkin added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2026
@traviscross traviscross added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Apr 22, 2026
@traviscross
Copy link
Copy Markdown
Contributor

In the meeting today, we talked a bit about the name. Framing it as "target has {property}" seems right, especially in light of the existing target_has_atomic. But the word "equal" here is a bit unfortunate — one wonders, "equal to what?"

This cfg is testing that align_of::<Atomic<T>>() == align_of::<T>(). I.e., that the alignment of the atomic for some type T is the inner alignment — the alignment of the inner type.

What about target_has_atomic_inner_alignment?

@steffahn
Copy link
Copy Markdown
Member

steffahn commented Apr 22, 2026

One potential naming concern with cfg(target_has_atomic_equal_alignment="N") is that reading aloud something like target_has_atomic="32" can already read out aloud as something like “target has atomic equal[s] thirty-two”, so there’s potential confusion in adding the wordequal” in that same position where an ”equals“ sign appears for a different (related) cfg flag.

When looking for possible other names, it also makes sense to keep in mind that this flag is going to be used with a ="N"-kind of suffix (or ="8"/="16"/="32"/="64"/="ptr") indicating which atomic size we’re talking about.

@steffahn
Copy link
Copy Markdown
Member

Types like u8, u16… etc make up a majority of “primitive” types. See also std::primitive. So I’ve been thinking reference to primitive could help answer the question of “what is it supposed to be equal to?”

In the space of “names starting with target_has_atomic_”, I’m able to come up with things like the following.

  • #[cfg(target_has_atomic_alignment_matching_primitive="32")]
  • #[cfg(target_has_atomic_aligned_like_primitive="32")]
  • #[cfg(target_has_atomic_primitive_align="32")]

@WaffleLapkin
Copy link
Copy Markdown
Member Author

WaffleLapkin commented Apr 24, 2026

Out of the proposals above I like #[cfg(target_has_atomic_primitive_align="32")] the most (with close second being #[cfg(target_has_atomic_aligned_like_primitive="32")]). What would be the next step, should I re-nominate this to check if T-lang would be okay with that (or other) name(s), or?..

@traviscross
Copy link
Copy Markdown
Contributor

It's still nominated. We'll pick it back up to discuss.

@traviscross
Copy link
Copy Markdown
Contributor

We talked about this in the lang call today. Let's propose to do it with the name cfg(target_has_atomic_primitive_alignment).

@rfcbot fcp merge lang

@rust-rfcbot
Copy link
Copy Markdown
Collaborator

rust-rfcbot commented May 6, 2026

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 6, 2026
@traviscross traviscross removed I-lang-nominated Nominated for discussion during a lang team meeting. P-lang-drag-1 Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang labels May 6, 2026
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels May 6, 2026
@rust-rfcbot
Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants