Skip to content

Commit aebf192

Browse files
committed
Revert "Move AtomicWaker from futures-core to futures-task"
This reverts commit dd664a3.
1 parent 5cc1f42 commit aebf192

File tree

12 files changed

+23
-30
lines changed

12 files changed

+23
-30
lines changed

futures-channel/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ sink = ["futures-sink-preview"]
2323
# Unstable features
2424
# These features are outside of the normal semver guarantees and require the
2525
# `unstable` feature as an explicit opt-in to unstable API.
26-
unstable = ["futures-core-preview/unstable", "futures-task-preview/unstable"]
27-
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-task-preview/cfg-target-has-atomic"]
26+
unstable = ["futures-core-preview/unstable"]
27+
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"]
2828

2929
[dependencies]
3030
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.19", default-features = false }
31-
futures-task-preview = { path = "../futures-task", version = "=0.3.0-alpha.19", default-features = false }
3231
futures-sink-preview = { path = "../futures-sink", version = "=0.3.0-alpha.19", default-features = false, optional = true }
3332

3433
[dev-dependencies]

futures-channel/src/mpsc/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181
use futures_core::stream::{FusedStream, Stream};
8282
use futures_core::task::{Context, Poll, Waker};
83-
use futures_task::AtomicWaker;
83+
use futures_core::task::__internal::AtomicWaker;
8484
use std::fmt;
8585
use std::pin::Pin;
8686
use std::sync::{Arc, Mutex};
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
2+
mod atomic_waker;
3+
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
4+
pub use self::atomic_waker::AtomicWaker;

futures-core/src/task/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//! Task notification.
2+
3+
#[macro_use]
4+
mod poll;
5+
6+
#[doc(hidden)]
7+
pub mod __internal;
8+
9+
pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};

futures-core/src/task.rs renamed to futures-core/src/task/poll.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//! Task notification.
2-
3-
pub use core::task::{Context, Poll, Waker, RawWaker, RawWakerVTable};
4-
51
/// Extracts the successful type of a `Poll<T>`.
62
///
73
/// This macro bakes in propagation of `Pending` signals by returning early.

futures-task/Cargo.toml

-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ default = ["std"]
1919
std = ["alloc"]
2020
alloc = []
2121

22-
# Unstable features
23-
# These features are outside of the normal semver guarantees and require the
24-
# `unstable` feature as an explicit opt-in to unstable API.
25-
unstable = []
26-
cfg-target-has-atomic = []
27-
2822
[dependencies]
2923

3024
[dev-dependencies]

futures-task/src/lib.rs

-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Tools for working with tasks.
22
3-
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]
4-
53
#![cfg_attr(not(feature = "std"), no_std)]
64

75
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms, unreachable_pub)]
@@ -13,9 +11,6 @@
1311

1412
#![doc(html_root_url = "https://docs.rs/futures-task-preview/0.3.0-alpha.19")]
1513

16-
#[cfg(all(feature = "cfg-target-has-atomic", not(feature = "unstable")))]
17-
compile_error!("The `cfg-target-has-atomic` feature requires the `unstable` feature as an explicit opt-in to unstable features");
18-
1914
#[cfg(feature = "alloc")]
2015
extern crate alloc;
2116

@@ -30,11 +25,6 @@ mod spawn;
3025
pub use crate::spawn::{Spawn, SpawnError, LocalSpawn};
3126

3227
cfg_target_has_atomic! {
33-
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
34-
mod atomic_waker;
35-
#[cfg_attr(feature = "cfg-target-has-atomic", cfg(target_has_atomic = "ptr"))]
36-
pub use crate::atomic_waker::AtomicWaker;
37-
3828
#[cfg(feature = "alloc")]
3929
mod arc_wake;
4030
#[cfg(feature = "alloc")]

futures-util/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ channel = ["std", "futures-channel-preview"]
2929
# Unstable features
3030
# These features are outside of the normal semver guarantees and require the
3131
# `unstable` feature as an explicit opt-in to unstable API.
32-
unstable = ["futures-core-preview/unstable", "futures-task-preview/unstable"]
33-
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-task-preview/cfg-target-has-atomic"]
32+
unstable = ["futures-core-preview/unstable"]
33+
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic"]
3434
bilock = []
3535
read-initializer = ["io", "futures-io-preview/read-initializer", "futures-io-preview/unstable"]
3636

futures-util/src/stream/futures_unordered/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
use futures_core::future::Future;
77
use futures_core::stream::{FusedStream, Stream};
88
use futures_core::task::{Context, Poll};
9-
use futures_task::{FutureObj, LocalFutureObj, AtomicWaker, Spawn, LocalSpawn, SpawnError};
9+
use futures_task::{FutureObj, LocalFutureObj, Spawn, LocalSpawn, SpawnError};
10+
use crate::task::AtomicWaker;
1011
use core::cell::UnsafeCell;
1112
use core::fmt::{self, Debug};
1213
use core::iter::FromIterator;

futures-util/src/task/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cfg_target_has_atomic! {
1010
#[cfg(feature = "alloc")]
1111
pub use futures_task::{waker_ref, WakerRef};
1212

13-
pub use futures_task::AtomicWaker;
13+
pub use futures_core::task::__internal::AtomicWaker;
1414
}
1515

1616
mod spawn;

futures/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ thread-pool = ["futures-executor-preview/thread-pool"]
4848
# Unstable features
4949
# These features are outside of the normal semver guarantees and require the
5050
# `unstable` feature as an explicit opt-in to unstable API.
51-
unstable = ["futures-core-preview/unstable", "futures-task-preview/unstable", "futures-channel-preview/unstable", "futures-io-preview/unstable", "futures-util-preview/unstable"]
52-
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-task-preview/cfg-target-has-atomic", "futures-channel-preview/cfg-target-has-atomic", "futures-util-preview/cfg-target-has-atomic"]
51+
unstable = ["futures-core-preview/unstable", "futures-channel-preview/unstable", "futures-io-preview/unstable", "futures-util-preview/unstable"]
52+
cfg-target-has-atomic = ["futures-core-preview/cfg-target-has-atomic", "futures-channel-preview/cfg-target-has-atomic", "futures-util-preview/cfg-target-has-atomic"]
5353
bilock = ["futures-util-preview/bilock"]
5454
read-initializer = ["futures-io-preview/read-initializer", "futures-util-preview/read-initializer"]
5555

0 commit comments

Comments
 (0)