Skip to content

Commit 96ddd4d

Browse files
committed
Support non-atomic targets
Refs: rust-lang/rust#51953
1 parent cafe143 commit 96ddd4d

File tree

9 files changed

+30
-0
lines changed

9 files changed

+30
-0
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ matrix:
4141
script: ./ci/crossbeam.sh
4242
install:
4343
- rustup target add thumbv7m-none-eabi
44+
- rustup target add thumbv6m-none-eabi
4445
- rust: nightly
4546
name: "crossbeam-channel on nightly"
4647
script: ./ci/crossbeam-channel.sh
@@ -52,6 +53,7 @@ matrix:
5253
script: ./ci/crossbeam-epoch.sh
5354
install:
5455
- rustup target add thumbv7m-none-eabi
56+
- rustup target add thumbv6m-none-eabi
5557
addons:
5658
apt:
5759
sources:
@@ -71,11 +73,13 @@ matrix:
7173
script: ./ci/crossbeam-skiplist.sh
7274
install:
7375
- rustup target add thumbv7m-none-eabi
76+
- rustup target add thumbv6m-none-eabi
7477
- rust: nightly
7578
name: "crossbeam-utils on nightly"
7679
script: ./ci/crossbeam-utils.sh
7780
install:
7881
- rustup target add thumbv7m-none-eabi
82+
- rustup target add thumbv6m-none-eabi
7983

8084
# Check for duplicate dependencies.
8185
- rust: nightly

ci/crossbeam-epoch.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
2525
cargo check --target thumbv7m-none-eabi --no-default-features
2626
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
2727
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
28+
cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
29+
cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
2830
fi

ci/crossbeam-skiplist.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
1717
cargo check --target thumbv7m-none-eabi --no-default-features
1818
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
1919
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
20+
cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
21+
cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
2022
fi

ci/crossbeam-utils.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
1717
cargo check --target thumbv7m-none-eabi --no-default-features
1818
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
1919
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
20+
cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
21+
cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
2022
fi

ci/crossbeam.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
1717
cargo check --target thumbv7m-none-eabi --no-default-features
1818
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc
1919
cargo check --target thumbv7m-none-eabi --no-default-features --features alloc,nightly
20+
cargo check --target thumbv6m-none-eabi --no-default-features --features nightly
21+
cargo check --target thumbv6m-none-eabi --no-default-features --features alloc,nightly
2022
fi

crossbeam-epoch/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#![warn(missing_debug_implementations)]
5959
#![cfg_attr(not(feature = "std"), no_std)]
6060
#![cfg_attr(feature = "nightly", feature(const_fn))]
61+
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]
6162

6263
#[macro_use]
6364
extern crate cfg_if;
@@ -72,6 +73,10 @@ cfg_if! {
7273
}
7374
}
7475

76+
#[cfg_attr(
77+
feature = "nightly",
78+
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
79+
)]
7580
cfg_if! {
7681
if #[cfg(any(feature = "alloc", feature = "std"))] {
7782
extern crate arrayvec;

crossbeam-skiplist/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#![warn(missing_docs)]
44
#![warn(missing_debug_implementations)]
55
#![cfg_attr(not(feature = "std"), no_std)]
6+
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]
67

78
#[macro_use]
89
extern crate cfg_if;
@@ -17,6 +18,10 @@ cfg_if! {
1718
}
1819
}
1920

21+
#[cfg_attr(
22+
feature = "nightly",
23+
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
24+
)]
2025
cfg_if! {
2126
if #[cfg(any(feature = "alloc", feature = "std"))] {
2227
extern crate crossbeam_epoch as epoch;

crossbeam-utils/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ cfg_if! {
4444
}
4545
}
4646

47+
#[cfg_attr(
48+
feature = "nightly",
49+
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
50+
)]
4751
pub mod atomic;
4852

4953
mod cache_padded;

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ pub use _epoch::crossbeam_epoch as epoch;
6868

6969
extern crate crossbeam_utils;
7070

71+
#[cfg_attr(
72+
feature = "nightly",
73+
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
74+
)]
7175
pub use crossbeam_utils::atomic;
7276

7377
/// Miscellaneous utilities.

0 commit comments

Comments
 (0)