Skip to content

Commit

Permalink
Document target_has_atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Apr 20, 2022
1 parent b5f6c23 commit 5316050
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/conditional-compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,28 @@ Example values:
* `"pc"`
* `"unknown"`

### `target_has_atomic`

Key-value option set for each bit width that the target supports
atomic loads, stores, and compare-and-swap operations.

When this cfg is present, all of the [`core::sync::atomic`] APIs are available for
the relevant atomic width with the exception of `from_mut` methods (currently
unstable), which additionally require that the primitive integer and atomic have
the same minimum alignment on the given target. No user-visible, stable cfg is
exposed for that method at this time.

[`core::sync::atomic`]: https://doc.rust-lang.org/nightly/core/sync/atomic/index.html

Possible values:

* `"8"`
* `"16"`
* `"32"`
* `"64"`
* `"128"`
* `"ptr"`

### `test`

Enabled when compiling the test harness. Done with `rustc` by using the
Expand Down

0 comments on commit 5316050

Please sign in to comment.