diff --git a/Cargo.toml b/Cargo.toml index 09a2ebbe46..ee3f7b83b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,10 @@ exclude = [".*"] # From 1.61.0, Rust supports generic types with trait bounds in `const fn`. zerocopy-generic-bounds-in-const-fn = "1.61.0" +# From 1.60.0, Rust supports detecting if a target supports atomics, so we can +# reliably implement traits on the Atomic* types. +zerocopy-atomics = "1.60.0" + # When the "simd" feature is enabled, include SIMD types from the # `core::arch::aarch64` module, which was stabilized in 1.59.0. On earlier Rust # versions, these types require the "simd-nightly" feature. diff --git a/src/lib.rs b/src/lib.rs index 0c54540c93..4f8394765d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -278,6 +278,7 @@ extern crate self as zerocopy; #[macro_use] mod macros; +#[cfg(zerocopy_atomics)] mod atomics; pub mod byteorder; mod deprecated;