You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-async-task/0001-Remove-async_await-fea...

211 lines
5.5 KiB

From 226b2529314d5a4c3e6c8d4620926abb4508751a Mon Sep 17 00:00:00 2001
From: Yuki Okushi <huyuumi.dev@gmail.com>
Date: Sun, 1 Sep 2019 03:46:57 +0900
Subject: [PATCH] Remove `async_await` feature gates (#4)
---
benches/bench.rs | 2 +-
examples/panic-propagation.rs | 2 --
examples/panic-result.rs | 2 --
examples/spawn-on-thread.rs | 2 --
examples/spawn.rs | 2 --
examples/task-id.rs | 2 --
src/lib.rs | 6 ------
src/task.rs | 2 --
tests/basic.rs | 2 --
tests/join.rs | 2 --
tests/panic.rs | 2 --
tests/ready.rs | 2 --
tests/waker_panic.rs | 2 --
tests/waker_pending.rs | 2 --
tests/waker_ready.rs | 2 --
15 files changed, 1 insertion(+), 33 deletions(-)
diff --git a/benches/bench.rs b/benches/bench.rs
index 6fd7935..c8f43d1 100644
--- a/benches/bench.rs
+++ b/benches/bench.rs
@@ -1,4 +1,4 @@
-#![feature(async_await, test)]
+#![feature(test)]
extern crate test;
diff --git a/examples/panic-propagation.rs b/examples/panic-propagation.rs
index 9c4f081..8a5339f 100644
--- a/examples/panic-propagation.rs
+++ b/examples/panic-propagation.rs
@@ -1,7 +1,5 @@
//! A single-threaded executor where join handles propagate panics from tasks.
-#![feature(async_await)]
-
use std::future::Future;
use std::panic::{resume_unwind, AssertUnwindSafe};
use std::pin::Pin;
diff --git a/examples/panic-result.rs b/examples/panic-result.rs
index b1200a3..7cf5a14 100644
--- a/examples/panic-result.rs
+++ b/examples/panic-result.rs
@@ -1,7 +1,5 @@
//! A single-threaded executor where join handles catch panics inside tasks.
-#![feature(async_await)]
-
use std::future::Future;
use std::panic::AssertUnwindSafe;
use std::thread;
diff --git a/examples/spawn-on-thread.rs b/examples/spawn-on-thread.rs
index 6d5b9a2..22da0c5 100644
--- a/examples/spawn-on-thread.rs
+++ b/examples/spawn-on-thread.rs
@@ -1,7 +1,5 @@
//! A function that runs a future to completion on a dedicated thread.
-#![feature(async_await)]
-
use std::future::Future;
use std::sync::Arc;
use std::thread;
diff --git a/examples/spawn.rs b/examples/spawn.rs
index 6e798c0..4af5a02 100644
--- a/examples/spawn.rs
+++ b/examples/spawn.rs
@@ -1,7 +1,5 @@
//! A simple single-threaded executor.
-#![feature(async_await)]
-
use std::future::Future;
use std::panic::catch_unwind;
use std::thread;
diff --git a/examples/task-id.rs b/examples/task-id.rs
index b3832d0..66b7aec 100644
--- a/examples/task-id.rs
+++ b/examples/task-id.rs
@@ -1,7 +1,5 @@
//! An executor that assigns an ID to every spawned task.
-#![feature(async_await)]
-
use std::cell::Cell;
use std::future::Future;
use std::panic::catch_unwind;
diff --git a/src/lib.rs b/src/lib.rs
index 2894cd1..153cb43 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -11,8 +11,6 @@
//! All executors have some kind of queue that holds runnable tasks:
//!
//! ```
-//! # #![feature(async_await)]
-//! #
//! let (sender, receiver) = crossbeam::channel::unbounded();
//! #
//! # // A future that will get spawned.
@@ -28,8 +26,6 @@
//! A task is constructed using the [`spawn`] function:
//!
//! ```
-//! # #![feature(async_await)]
-//! #
//! # let (sender, receiver) = crossbeam::channel::unbounded();
//! #
//! // A future that will be spawned.
@@ -56,8 +52,6 @@
//! runnable tasks out of the queue and running each one in order:
//!
//! ```no_run
-//! # #![feature(async_await)]
-//! #
//! # let (sender, receiver) = crossbeam::channel::unbounded();
//! #
//! # // A future that will get spawned.
diff --git a/src/task.rs b/src/task.rs
index b09f602..9097f44 100644
--- a/src/task.rs
+++ b/src/task.rs
@@ -22,8 +22,6 @@ use crate::JoinHandle;
/// # Examples
///
/// ```
-/// # #![feature(async_await)]
-/// #
/// use crossbeam::channel;
///
/// // The future inside the task.
diff --git a/tests/basic.rs b/tests/basic.rs
index b9e181b..8c8734c 100644
--- a/tests/basic.rs
+++ b/tests/basic.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::future::Future;
use std::pin::Pin;
use std::sync::atomic::{AtomicUsize, Ordering};
diff --git a/tests/join.rs b/tests/join.rs
index e082939..4bfa7fd 100644
--- a/tests/join.rs
+++ b/tests/join.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::cell::Cell;
use std::future::Future;
use std::pin::Pin;
diff --git a/tests/panic.rs b/tests/panic.rs
index 68058a2..ef917dc 100644
--- a/tests/panic.rs
+++ b/tests/panic.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::future::Future;
use std::panic::catch_unwind;
use std::pin::Pin;
diff --git a/tests/ready.rs b/tests/ready.rs
index ecca328..abdeb90 100644
--- a/tests/ready.rs
+++ b/tests/ready.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
diff --git a/tests/waker_panic.rs b/tests/waker_panic.rs
index a683f26..3a8dfe8 100644
--- a/tests/waker_panic.rs
+++ b/tests/waker_panic.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::cell::Cell;
use std::future::Future;
use std::panic::catch_unwind;
diff --git a/tests/waker_pending.rs b/tests/waker_pending.rs
index 547ff7a..96d9c6b 100644
--- a/tests/waker_pending.rs
+++ b/tests/waker_pending.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::future::Future;
use std::pin::Pin;
use std::task::Waker;
diff --git a/tests/waker_ready.rs b/tests/waker_ready.rs
index e64cc55..800d6ae 100644
--- a/tests/waker_ready.rs
+++ b/tests/waker_ready.rs
@@ -1,5 +1,3 @@
-#![feature(async_await)]
-
use std::cell::Cell;
use std::future::Future;
use std::pin::Pin;
--
2.24.1