Skip to content

Commit 5316050

Browse files
Document target_has_atomic
1 parent b5f6c23 commit 5316050

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/conditional-compilation.md

+22
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,28 @@ Example values:
191191
* `"pc"`
192192
* `"unknown"`
193193

194+
### `target_has_atomic`
195+
196+
Key-value option set for each bit width that the target supports
197+
atomic loads, stores, and compare-and-swap operations.
198+
199+
When this cfg is present, all of the [`core::sync::atomic`] APIs are available for
200+
the relevant atomic width with the exception of `from_mut` methods (currently
201+
unstable), which additionally require that the primitive integer and atomic have
202+
the same minimum alignment on the given target. No user-visible, stable cfg is
203+
exposed for that method at this time.
204+
205+
[`core::sync::atomic`]: https://doc.rust-lang.org/nightly/core/sync/atomic/index.html
206+
207+
Possible values:
208+
209+
* `"8"`
210+
* `"16"`
211+
* `"32"`
212+
* `"64"`
213+
* `"128"`
214+
* `"ptr"`
215+
194216
### `test`
195217

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

0 commit comments

Comments
 (0)