Skip to content

Commit a2c9b30

Browse files
committed
Gate atomics behind Rust 1.60
Signed-off-by: Joe Richey <[email protected]>
1 parent 4dc15bd commit a2c9b30

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ exclude = [".*"]
3535
# From 1.61.0, Rust supports generic types with trait bounds in `const fn`.
3636
zerocopy-generic-bounds-in-const-fn = "1.61.0"
3737

38+
# From 1.60.0, Rust supports detecting if a target supports atomics, so we can
39+
# reliably implement traits on the Atomic* types.
40+
zerocopy-atomics = "1.60.0"
41+
3842
# When the "simd" feature is enabled, include SIMD types from the
3943
# `core::arch::aarch64` module, which was stabilized in 1.59.0. On earlier Rust
4044
# versions, these types require the "simd-nightly" feature.

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ extern crate self as zerocopy;
278278
#[macro_use]
279279
mod macros;
280280

281+
#[cfg(zerocopy_atomics)]
281282
mod atomics;
282283
pub mod byteorder;
283284
mod deprecated;

0 commit comments

Comments
 (0)