diff --git a/.travis.yml b/.travis.yml index bdeb2e5e9b..24028c3452 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,17 +64,26 @@ matrix: script: - cargo build --manifest-path futures/Cargo.toml --features io-compat - # Allow build fail until #1396 is fixed. - name: cargo build --target=thumbv6m-none-eabi rust: nightly - env: ALLOW_FAILURES=true install: - rustup target add thumbv6m-none-eabi script: + - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml - cargo build --manifest-path futures/Cargo.toml --target thumbv6m-none-eabi --no-default-features - --features nightly + --features nightly,cfg-target-has-atomic + + - name: cargo build --target=thumbv7m-none-eabi + rust: nightly + install: + - rustup target add thumbv7m-none-eabi + script: + - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml + - cargo build --manifest-path futures/Cargo.toml + --target thumbv7m-none-eabi + --no-default-features - name: cargo doc rust: nightly @@ -102,10 +111,6 @@ matrix: - git commit -m "Add API docs for $TRAVIS_TAG" - git push origin master - allow_failures: - - rust: nightly - env: ALLOW_FAILURES=true - script: - cargo test --all --all-features - cargo test --all --all-features --release diff --git a/ci/remove-dev-dependencies/Cargo.toml b/ci/remove-dev-dependencies/Cargo.toml new file mode 100644 index 0000000000..bf0fc53853 --- /dev/null +++ b/ci/remove-dev-dependencies/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "remove-dev-dependencies" +version = "0.1.0" +authors = ["Wim Looman "] +edition = "2018" +publish = false + +[workspace] + +[dependencies] +toml_edit = "0.1.3" diff --git a/ci/remove-dev-dependencies/src/main.rs b/ci/remove-dev-dependencies/src/main.rs new file mode 100644 index 0000000000..0b5b0452fe --- /dev/null +++ b/ci/remove-dev-dependencies/src/main.rs @@ -0,0 +1,12 @@ +use std::{env, error::Error, fs}; + +fn main() -> Result<(), Box> { + for file in env::args().skip(1) { + let content = fs::read_to_string(&file)?; + let mut doc: toml_edit::Document = content.parse()?; + doc.as_table_mut().remove("dev-dependencies"); + fs::write(file, doc.to_string())?; + } + + Ok(()) +} diff --git a/futures-util/src/lib.rs b/futures-util/src/lib.rs index 342d6bac1e..ef58330bcd 100644 --- a/futures-util/src/lib.rs +++ b/futures-util/src/lib.rs @@ -1,8 +1,8 @@ //! Combinators and utilities for working with `Future`s, `Stream`s, `Sink`s, //! and the `AsyncRead` and `AsyncWrite` traits. -#![feature(futures_api, box_into_pin)] -#![cfg_attr(feature = "std", feature(async_await, await_macro))] +#![feature(futures_api)] +#![cfg_attr(feature = "std", feature(async_await, await_macro, box_into_pin))] #![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))] #![cfg_attr(not(feature = "std"), no_std)] diff --git a/futures-util/src/task/mod.rs b/futures-util/src/task/mod.rs index 4867f9cb9b..af7e783d33 100644 --- a/futures-util/src/task/mod.rs +++ b/futures-util/src/task/mod.rs @@ -6,7 +6,9 @@ mod arc_wake; pub use self::arc_wake::ArcWake; mod noop_waker; -pub use self::noop_waker::{noop_waker, noop_waker_ref}; +pub use self::noop_waker::noop_waker; +#[cfg(feature = "std")] +pub use self::noop_waker::noop_waker_ref; mod spawn; pub use self::spawn::{SpawnExt, LocalSpawnExt}; diff --git a/futures-util/src/task/noop_waker.rs b/futures-util/src/task/noop_waker.rs index 4e720bec62..667d413a88 100644 --- a/futures-util/src/task/noop_waker.rs +++ b/futures-util/src/task/noop_waker.rs @@ -1,6 +1,7 @@ //! Utilities for creating zero-cost wakers that don't do anything. use futures_core::task::{RawWaker, RawWakerVTable, Waker}; use core::ptr::null; +#[cfg(feature = "std")] use core::cell::UnsafeCell; unsafe fn noop_clone(_data: *const()) -> RawWaker { @@ -52,6 +53,7 @@ pub fn noop_waker() -> Waker { /// lw.wake(); /// ``` #[inline] +#[cfg(feature = "std")] pub fn noop_waker_ref() -> &'static Waker { thread_local! { static NOOP_WAKER_INSTANCE: UnsafeCell = diff --git a/futures/src/lib.rs b/futures/src/lib.rs index 51b03dabf1..89526cd3cb 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -207,6 +207,10 @@ pub mod future { AndThen, ErrInto, FlattenSink, IntoFuture, MapErr, MapOk, OrElse, UnwrapOrElse, TryJoin, TryJoin3, TryJoin4, TryJoin5, + }; + + #[cfg(feature = "std")] + pub use futures_util::try_future::{ try_join_all, TryJoinAll, }; } @@ -364,18 +368,17 @@ pub mod task { Waker, RawWaker, RawWakerVTable }; + pub use futures_util::task::noop_waker; + #[cfg(feature = "std")] pub use futures_util::task::{ WakerRef, waker_ref, ArcWake, SpawnExt, LocalSpawnExt, - }; - - pub use futures_util::task::{ - noop_waker, noop_waker_ref, + noop_waker_ref, }; #[cfg_attr( - feature = "target-has-atomic", + feature = "cfg-target-has-atomic", cfg(all(target_has_atomic = "cas", target_has_atomic = "ptr")) )] pub use futures_util::task::AtomicWaker;