Skip to content

Stabilize alloc feature #1515

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

Merged
merged 2 commits into from
Apr 15, 2019
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ matrix:

# When updating this, the reminder to update the minimum required version in README.md.
- name: cargo test (minimum required version)
rust: nightly-2019-04-13
rust: nightly-2019-04-15

- name: cargo clippy
rust: nightly
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Now, you can use futures-rs:
use futures::future::Future; // Note: It's not `futures_preview`
```

The current version of futures-rs requires Rust nightly 2019-04-13 or later.
The current version of futures-rs requires Rust nightly 2019-04-15 or later.

### Feature `std`

Expand Down
8 changes: 1 addition & 7 deletions futures-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#![feature(futures_api)]
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))]

#![cfg_attr(not(feature = "std"), no_std)]

Expand All @@ -13,13 +12,8 @@
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))]
compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features");

#[cfg(all(feature = "alloc", not(any(feature = "std", feature = "nightly"))))]
compile_error!("The `alloc` feature without `std` requires the `nightly` feature active to explicitly opt-in to unstable features");

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std as alloc;

pub mod future;
#[doc(hidden)] pub use self::future::{Future, FusedFuture, TryFuture};
Expand Down
8 changes: 1 addition & 7 deletions futures-sink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.13/futures_sink")]

#![feature(futures_api)]
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))]

#[cfg(all(feature = "alloc", not(any(feature = "std", feature = "nightly"))))]
compile_error!("The `alloc` feature without `std` requires the `nightly` feature active to explicitly opt-in to unstable features");

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std as alloc;

use futures_core::task::{Context, Poll};
use core::pin::Pin;
Expand Down
3 changes: 2 additions & 1 deletion futures-util/src/future/join_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use core::iter::FromIterator;
use core::mem;
use core::pin::Pin;
use core::task::{Context, Poll};
use alloc::prelude::v1::*;
use alloc::boxed::Box;
use alloc::vec::Vec;

#[derive(Debug)]
enum ElemState<F>
Expand Down
8 changes: 1 addition & 7 deletions futures-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![cfg_attr(feature = "alloc", feature(box_into_pin))]
#![cfg_attr(feature = "std", feature(async_await, await_macro))]
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc, alloc_prelude))]

#![cfg_attr(not(feature = "std"), no_std)]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
Expand All @@ -15,13 +14,8 @@
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))]
compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features");

#[cfg(all(feature = "alloc", not(any(feature = "std", feature = "nightly"))))]
compile_error!("The `alloc` feature without `std` requires the `nightly` feature active to explicitly opt-in to unstable features");

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std as alloc;

#[macro_use]
mod macros;
Expand Down
2 changes: 1 addition & 1 deletion futures-util/src/stream/chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use futures_sink::Sink;
use pin_utils::{unsafe_pinned, unsafe_unpinned};
use core::mem;
use core::pin::Pin;
use alloc::prelude::v1::*;
use alloc::vec::Vec;

/// Stream for the [`chunks`](super::StreamExt::chunks) method.
#[derive(Debug)]
Expand Down
3 changes: 2 additions & 1 deletion futures-util/src/try_future/try_join_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use core::iter::FromIterator;
use core::mem;
use core::pin::Pin;
use core::task::{Context, Poll};
use alloc::prelude::v1::*;
use alloc::boxed::Box;
use alloc::vec::Vec;

use super::TryFuture;

Expand Down
4 changes: 0 additions & 4 deletions futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#![feature(futures_api)]
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
#![cfg_attr(all(feature = "alloc", not(feature = "std")), feature(alloc))]

#![cfg_attr(not(feature = "std"), no_std)]

Expand All @@ -34,9 +33,6 @@
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "nightly")))]
compile_error!("The `cfg-target-has-atomic` feature requires the `nightly` feature as an explicit opt-in to unstable features");

#[cfg(all(feature = "alloc", not(any(feature = "std", feature = "nightly"))))]
compile_error!("The `alloc` feature without `std` requires the `nightly` feature active to explicitly opt-in to unstable features");

#[doc(hidden)] pub use futures_util::core_reexport;

#[doc(hidden)] pub use futures_core::future::Future;
Expand Down