Skip to content

Include AtomicU128/AtomicI128 in docs for any target#155811

Open
pluiee wants to merge 1 commit intorust-lang:mainfrom
pluiee:pluiee/atomic-128-doc
Open

Include AtomicU128/AtomicI128 in docs for any target#155811
pluiee wants to merge 1 commit intorust-lang:mainfrom
pluiee:pluiee/atomic-128-doc

Conversation

@pluiee
Copy link
Copy Markdown
Contributor

@pluiee pluiee commented Apr 26, 2026

Fixes #130474

This is my first contribution, so I'll try to be as descriptive as possible of my process and thoughts.

  • Environment: Cross compiled in Macbook M1 Air
  • Testing: I replicated the bug and checked fixes with ./x doc library/core --target x86_64-unknown-linux-gnu (building the std doc didn't seem to apply my local changes so I used the core doc) Check the screenshots below.
  • Diffs: I added #[cfg(any(...,doc))] to all required structs and implementations so the types would compile. Applyingtarget_has_atomic_equal_alignment part wasn't explicitly necessary, but adding it reveals the whole methods (specifically from_mut and from_mut_slice).
  • Thoughts: Also wondered if additional messages should be written to notify the available targets, but the documentation already included the following sentence that seemed enough.
    • Note: This type is only available on platforms that support atomic loads and stores of u128/i128

[Before]
image

[After]
image


After the first work, doc tests were failing in CI, so I added #[$cfg_cas] to all methods in the atomic_int macro to cover them. But I'm not really sure if all these changes are necessary (and appropriate).
This also has a side-effect of stating "Available on target_has_atomic=128 only." for all methods with the attribute. Also not sure if this is a good behavior..
image

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 26, 2026
@rust-log-analyzer

This comment has been minimized.

@pluiee pluiee force-pushed the pluiee/atomic-128-doc branch from cbcafea to 6e7e00b Compare April 26, 2026 12:11
@pluiee pluiee marked this pull request as ready for review April 26, 2026 13:38
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 26, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 26, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: @scottmcm, libs
  • @scottmcm, libs expanded to 7 candidates
  • Random selection from Mark-Simulacrum, jhpratt, scottmcm

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

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

AtomicU128/AtomicI128 not shown in std docs on rust-lang.org

4 participants