Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-atomic targets #1089

Merged
merged 1 commit into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ matrix:
- cargo build --manifest-path futures-executor/Cargo.toml --no-default-features
- cargo build --manifest-path futures-sink/Cargo.toml --no-default-features
- cargo build --manifest-path futures-util/Cargo.toml --no-default-features
# - rust: nightly
# script:
# - rustup component add rust-src
# - cargo install xargo
# - xargo build --manifest-path futures/Cargo.toml --target thumbv6m-none-eabi --no-default-features
- rust: nightly
script:
- rustup target add thumbv6m-none-eabi
- cargo build --manifest-path futures/Cargo.toml --target thumbv6m-none-eabi --no-default-features --features nightly
# - rust: 1.20.0
# script: cargo test --all
# - rust: nightly
Expand Down
2 changes: 0 additions & 2 deletions futures-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#![doc(html_root_url = "https://docs.rs/futures-core/0.3.0-alpha")]

#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]

#[cfg(feature = "std")]
extern crate std;

Expand Down
1 change: 1 addition & 0 deletions futures-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//! and the `AsyncRead` and `AsyncWrite` traits.

#![feature(async_await, await_macro, pin, arbitrary_self_types, futures_api)]
#![cfg_attr(feature = "nightly", feature(cfg_target_has_atomic))]

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(missing_docs, missing_debug_implementations, warnings)]
Expand Down
10 changes: 8 additions & 2 deletions futures-util/src/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
mod context;
pub use self::context::ContextExt;

#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))]
#[cfg_attr(
feature = "nightly",
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
)]
mod atomic_waker;
#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))]
#[cfg_attr(
feature = "nightly",
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
)]
pub use self::atomic_waker::AtomicWaker;
5 changes: 4 additions & 1 deletion futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ pub mod task {

pub use futures_util::task::ContextExt;

#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))]
#[cfg_attr(
feature = "nightly",
cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr"))
)]
pub use futures_util::task::AtomicWaker;

#[cfg(feature = "std")]
Expand Down