]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/async-await.rs
Stabilize futures_api
[rust.git] / src / test / run-pass / async-await.rs
index 4f5f7724ad076d4612254ce1db243b6f4f7aa9d6..e1b4328debd9a8918e7bea0c3e4aa16326bc31a9 100644 (file)
@@ -1,7 +1,7 @@
 // edition:2018
 // aux-build:arc_wake.rs
 
-#![feature(async_await, await_macro, futures_api)]
+#![feature(async_await, await_macro)]
 
 extern crate arc_wake;
 
@@ -19,7 +19,10 @@ struct Counter {
 }
 
 impl ArcWake for Counter {
-    fn wake(arc_self: &Arc<Self>) {
+    fn wake(self: Arc<Self>) {
+        Self::wake_by_ref(&self)
+    }
+    fn wake_by_ref(arc_self: &Arc<Self>) {
         arc_self.wakes.fetch_add(1, atomic::Ordering::SeqCst);
     }
 }
@@ -34,7 +37,7 @@ fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
         if self.0 {
             Poll::Ready(())
         } else {
-            cx.waker().wake();
+            cx.waker().wake_by_ref();
             self.0 = true;
             Poll::Pending
         }