diff options
Diffstat (limited to 'tokio-sync')
-rw-r--r-- | tokio-sync/Cargo.toml | 4 | ||||
-rw-r--r-- | tokio-sync/src/lib.rs | 13 | ||||
-rw-r--r-- | tokio-sync/src/lock.rs | 1 | ||||
-rw-r--r-- | tokio-sync/src/oneshot.rs | 1 | ||||
-rw-r--r-- | tokio-sync/src/watch.rs | 1 | ||||
-rw-r--r-- | tokio-sync/tests/fuzz_oneshot.rs | 13 | ||||
-rw-r--r-- | tokio-sync/tests/fuzz_semaphore.rs | 14 |
7 files changed, 6 insertions, 41 deletions
diff --git a/tokio-sync/Cargo.toml b/tokio-sync/Cargo.toml index 66022b30..e8fddf16 100644 --- a/tokio-sync/Cargo.toml +++ b/tokio-sync/Cargo.toml @@ -22,13 +22,13 @@ categories = ["asynchronous"] publish = false [features] -async-traits = ["tokio-futures", "futures-core-preview"] +async-traits = ["tokio-futures"] [dependencies] async-util = { git = "https://github.com/tokio-rs/async" } tokio-futures = { path = "../tokio-futures", optional = true } fnv = "1.0.6" -futures-core-preview = { version = "0.3.0-alpha.17", optional = true } +futures-core-preview = { version = "0.3.0-alpha.17" } [dev-dependencies] env_logger = { version = "0.5", default-features = false } diff --git a/tokio-sync/src/lib.rs b/tokio-sync/src/lib.rs index 384740ac..00f9b700 100644 --- a/tokio-sync/src/lib.rs +++ b/tokio-sync/src/lib.rs @@ -21,19 +21,6 @@ macro_rules! debug { } } -/// Unwrap a ready value or propagate `Poll::Pending`. -#[macro_export] -macro_rules! ready { - ($e:expr) => {{ - use std::task::Poll::{Pending, Ready}; - - match $e { - Ready(v) => v, - Pending => return Pending, - } - }}; -} - macro_rules! if_fuzz { ($($t:tt)*) => {{ if false { $($t)* } diff --git a/tokio-sync/src/lock.rs b/tokio-sync/src/lock.rs index 10f6a112..8b2bc0bc 100644 --- a/tokio-sync/src/lock.rs +++ b/tokio-sync/src/lock.rs @@ -42,6 +42,7 @@ use crate::semaphore; +use futures_core::ready; use std::cell::UnsafeCell; use std::fmt; use std::future::Future; diff --git a/tokio-sync/src/oneshot.rs b/tokio-sync/src/oneshot.rs index 910d24dd..86f1cd82 100644 --- a/tokio-sync/src/oneshot.rs +++ b/tokio-sync/src/oneshot.rs @@ -2,6 +2,7 @@ use crate::loom::{sync::atomic::AtomicUsize, sync::CausalCell}; +use futures_core::ready; use std::fmt; use std::future::Future; use std::mem::{self, ManuallyDrop}; diff --git a/tokio-sync/src/watch.rs b/tokio-sync/src/watch.rs index ed35b0aa..91d5d2b5 100644 --- a/tokio-sync/src/watch.rs +++ b/tokio-sync/src/watch.rs @@ -58,6 +58,7 @@ use crate::task::AtomicWaker; use core::task::Poll::{Pending, Ready}; use core::task::{Context, Poll}; use fnv::FnvHashMap; +use futures_core::ready; use std::ops; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering::SeqCst; diff --git a/tokio-sync/tests/fuzz_oneshot.rs b/tokio-sync/tests/fuzz_oneshot.rs index f8987af6..eb4dfcde 100644 --- a/tokio-sync/tests/fuzz_oneshot.rs +++ b/tokio-sync/tests/fuzz_oneshot.rs @@ -1,19 +1,6 @@ #![deny(warnings, rust_2018_idioms)] #![feature(async_await)] -/// Unwrap a ready value or propagate `Async::Pending`. -#[macro_export] -macro_rules! ready { - ($e:expr) => {{ - use std::task::Poll::{Pending, Ready}; - - match $e { - Ready(v) => v, - Pending => return Pending, - } - }}; -} - #[path = "../src/oneshot.rs"] #[allow(warnings)] mod oneshot; diff --git a/tokio-sync/tests/fuzz_semaphore.rs b/tokio-sync/tests/fuzz_semaphore.rs index ca2fda8b..55d6bf0d 100644 --- a/tokio-sync/tests/fuzz_semaphore.rs +++ b/tokio-sync/tests/fuzz_semaphore.rs @@ -10,6 +10,7 @@ mod semaphore; use crate::semaphore::*; use async_util::future::poll_fn; +use futures_core::ready; use loom::futures::block_on; use loom::thread; use std::future::Future; @@ -20,19 +21,6 @@ use std::sync::Arc; use std::task::Poll::Ready; use std::task::{Context, Poll}; -/// Unwrap a ready value or propagate `Poll::Pending`. -#[macro_export] -macro_rules! ready { - ($e:expr) => {{ - use std::task::Poll::{Pending, Ready}; - - match $e { - Ready(v) => v, - Pending => return Pending, - } - }}; -} - #[test] fn basic_usage() { const NUM: usize = 2; |