From 5316050cc3783b3215ea71038dbb1d03cd63b9e5 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 15 Feb 2022 21:50:35 -0500 Subject: [PATCH 1/3] 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 From 1ae3accbc7038fba2677a9b8cb95c85cf9ae9e58 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 20 Apr 2022 17:16:30 -0700 Subject: [PATCH 2/3] Use relative link for core::sync::atomic --- src/conditional-compilation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index a9a63daec..3f6173e67 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -202,7 +202,7 @@ 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 +[`core::sync::atomic`]: ../core/sync/atomic/index.html Possible values: From 2325d952d11ff817ce50c0c1a96b81517f566c51 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 3 Oct 2022 18:57:35 -0400 Subject: [PATCH 3/3] Remove unstable API mention --- src/conditional-compilation.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index 3f6173e67..97840e4f6 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -196,11 +196,8 @@ Example values: 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. +When this cfg is present, all of the stable [`core::sync::atomic`] APIs are available for +the relevant atomic width. [`core::sync::atomic`]: ../core/sync/atomic/index.html