From 5316050cc3783b3215ea71038dbb1d03cd63b9e5 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 15 Feb 2022 21:50:35 -0500 Subject: [PATCH] Document target_has_atomic --- src/conditional-compilation.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index 6966cec4f..a9a63daec 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -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