From 3eef0cbfe2e45157efb86030200d806e06533689 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 4 Jul 2019 00:25:14 +0200 Subject: [PATCH] Reduce reliance on feature(await_macro). --- src/test/run-pass/async-await/async-fn-size.rs | 16 ++++++++-------- src/test/run-pass/async-await/issue-60709.rs | 4 ++-- src/test/ui/async-await/async-fn-path-elision.rs | 2 +- src/test/ui/async-await/async-with-closure.rs | 4 ++-- .../2018-edition-error-in-non-macro-position.rs | 2 +- ...der-for-async-fn-parameters-by-ref-binding.rs | 2 +- .../drop-order-for-async-fn-parameters.rs | 2 +- src/test/ui/async-await/issues/issue-53249.rs | 6 +++--- src/test/ui/async-await/issues/issue-54974.rs | 2 +- src/test/ui/async-await/issues/issue-55324.rs | 4 ++-- src/test/ui/async-await/issues/issue-58885.rs | 2 +- src/test/ui/async-await/issues/issue-59001.rs | 2 +- src/test/ui/async-await/issues/issue-59972.rs | 4 ++-- .../ui/async-await/multiple-lifetimes/hrtb.rs | 2 +- .../no-args-non-move-async-closure.rs | 2 +- .../recursive-async-impl-trait-type.rs | 4 ++-- 16 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/test/run-pass/async-await/async-fn-size.rs b/src/test/run-pass/async-await/async-fn-size.rs index c4e328560ddf7..7396918196c08 100644 --- a/src/test/run-pass/async-await/async-fn-size.rs +++ b/src/test/run-pass/async-await/async-fn-size.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] #[path = "../auxiliary/arc_wake.rs"] mod arc_wake; @@ -58,31 +58,31 @@ fn wait(fut: impl Future) -> u8 { fn base() -> WakeOnceThenComplete { WakeOnceThenComplete(false, 1) } async fn await1_level1() -> u8 { - await!(base()) + base().await } async fn await2_level1() -> u8 { - await!(base()) + await!(base()) + base().await + base().await } async fn await3_level1() -> u8 { - await!(base()) + await!(base()) + await!(base()) + base().await + base().await + base().await } async fn await3_level2() -> u8 { - await!(await3_level1()) + await!(await3_level1()) + await!(await3_level1()) + await3_level1().await + await3_level1().await + await3_level1().await } async fn await3_level3() -> u8 { - await!(await3_level2()) + await!(await3_level2()) + await!(await3_level2()) + await3_level2().await + await3_level2().await + await3_level2().await } async fn await3_level4() -> u8 { - await!(await3_level3()) + await!(await3_level3()) + await!(await3_level3()) + await3_level3().await + await3_level3().await + await3_level3().await } async fn await3_level5() -> u8 { - await!(await3_level4()) + await!(await3_level4()) + await!(await3_level4()) + await3_level4().await + await3_level4().await + await3_level4().await } fn main() { diff --git a/src/test/run-pass/async-await/issue-60709.rs b/src/test/run-pass/async-await/issue-60709.rs index 778d3ee0c7083..5ebb18b999ab6 100644 --- a/src/test/run-pass/async-await/issue-60709.rs +++ b/src/test/run-pass/async-await/issue-60709.rs @@ -2,7 +2,7 @@ // handled incorrectly in generators. // compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] #![allow(unused)] use std::future::Future; @@ -22,7 +22,7 @@ impl Future for Never { fn main() { let fut = async { let _rc = Rc::new(()); // Also crashes with Arc - await!(Never()); + Never().await; }; let _bla = fut; // Moving the future is required. } diff --git a/src/test/ui/async-await/async-fn-path-elision.rs b/src/test/ui/async-await/async-fn-path-elision.rs index 8db7631ef4108..447e40dddd910 100644 --- a/src/test/ui/async-await/async-fn-path-elision.rs +++ b/src/test/ui/async-await/async-fn-path-elision.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] #![allow(dead_code)] struct HasLifetime<'a>(&'a bool); diff --git a/src/test/ui/async-await/async-with-closure.rs b/src/test/ui/async-await/async-with-closure.rs index e94a5f0853d72..072b7cea89dda 100644 --- a/src/test/ui/async-await/async-with-closure.rs +++ b/src/test/ui/async-await/async-with-closure.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] trait MyClosure { type Args; @@ -20,7 +20,7 @@ async fn get_future(_stream: MyStream) {} async fn f() { let messages: MyStream = unimplemented!(); - await!(get_future(messages)); + get_future(messages).await; } fn main() {} diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs index f59f1160e703e..92f3210ac89a3 100644 --- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs +++ b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs @@ -1,7 +1,7 @@ // edition:2018 #![allow(non_camel_case_types)] -#![feature(async_await, await_macro)] +#![feature(async_await)] mod outer_mod { pub mod await { //~ ERROR expected identifier, found reserved keyword `await` diff --git a/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters-by-ref-binding.rs b/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters-by-ref-binding.rs index c2b59eecb9993..dfd8b2e361eef 100644 --- a/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters-by-ref-binding.rs +++ b/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters-by-ref-binding.rs @@ -3,7 +3,7 @@ // run-pass #![allow(unused_variables)] -#![feature(async_await, await_macro)] +#![feature(async_await)] // Test that the drop order for parameters in a fn and async fn matches up. Also test that // parameters (used or unused) are not dropped until the async fn completes execution. diff --git a/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs b/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs index 708c570498460..2a74485afb450 100644 --- a/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs +++ b/src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs @@ -3,7 +3,7 @@ // run-pass #![allow(unused_variables)] -#![feature(async_await, await_macro)] +#![feature(async_await)] // Test that the drop order for parameters in a fn and async fn matches up. Also test that // parameters (used or unused) are not dropped until the async fn completes execution. diff --git a/src/test/ui/async-await/issues/issue-53249.rs b/src/test/ui/async-await/issues/issue-53249.rs index 2157cf7d4f7ab..35a7b40912c87 100644 --- a/src/test/ui/async-await/issues/issue-53249.rs +++ b/src/test/ui/async-await/issues/issue-53249.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(arbitrary_self_types, async_await, await_macro)] +#![feature(arbitrary_self_types, async_await)] use std::task::{self, Poll}; use std::future::Future; @@ -37,11 +37,11 @@ impl Future for Lazy async fn __receive(want: WantFn) -> () where Fut: Future, WantFn: Fn(&Box) -> Fut, { - await!(lazy(|_| ())); + lazy(|_| ()).await; } pub fn basic_spawn_receive() { - async { await!(__receive(|_| async { () })) }; + async { __receive(|_| async { () }).await }; } fn main() {} diff --git a/src/test/ui/async-await/issues/issue-54974.rs b/src/test/ui/async-await/issues/issue-54974.rs index ad18f41187569..7e3934b835782 100644 --- a/src/test/ui/async-await/issues/issue-54974.rs +++ b/src/test/ui/async-await/issues/issue-54974.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] use std::sync::Arc; diff --git a/src/test/ui/async-await/issues/issue-55324.rs b/src/test/ui/async-await/issues/issue-55324.rs index 4572e543f22de..6db0e8b8d5f07 100644 --- a/src/test/ui/async-await/issues/issue-55324.rs +++ b/src/test/ui/async-await/issues/issue-55324.rs @@ -1,13 +1,13 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] use std::future::Future; #[allow(unused)] async fn foo>(x: &i32, future: F) -> i32 { - let y = await!(future); + let y = future.await; *x + y } diff --git a/src/test/ui/async-await/issues/issue-58885.rs b/src/test/ui/async-await/issues/issue-58885.rs index 99d87b2273c2f..3dc4b0606335e 100644 --- a/src/test/ui/async-await/issues/issue-58885.rs +++ b/src/test/ui/async-await/issues/issue-58885.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] struct Xyz { a: u64, diff --git a/src/test/ui/async-await/issues/issue-59001.rs b/src/test/ui/async-await/issues/issue-59001.rs index c758244002ff6..b3b682f72322e 100644 --- a/src/test/ui/async-await/issues/issue-59001.rs +++ b/src/test/ui/async-await/issues/issue-59001.rs @@ -1,7 +1,7 @@ // compile-pass // edition:2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] use std::future::Future; diff --git a/src/test/ui/async-await/issues/issue-59972.rs b/src/test/ui/async-await/issues/issue-59972.rs index 31e7a65dc98e3..1b843720102ab 100644 --- a/src/test/ui/async-await/issues/issue-59972.rs +++ b/src/test/ui/async-await/issues/issue-59972.rs @@ -2,7 +2,7 @@ // compile-flags: --edition=2018 -#![feature(async_await, await_macro)] +#![feature(async_await)] pub enum Uninhabited { } @@ -15,7 +15,7 @@ async fn noop() { } #[allow(unused)] async fn contains_never() { let error = uninhabited_async(); - await!(noop()); + noop().await; let error2 = error; } diff --git a/src/test/ui/async-await/multiple-lifetimes/hrtb.rs b/src/test/ui/async-await/multiple-lifetimes/hrtb.rs index 620b0080966b9..589e260d084b2 100644 --- a/src/test/ui/async-await/multiple-lifetimes/hrtb.rs +++ b/src/test/ui/async-await/multiple-lifetimes/hrtb.rs @@ -3,7 +3,7 @@ // Test that we can use async fns with multiple arbitrary lifetimes. -#![feature(arbitrary_self_types, async_await, await_macro)] +#![feature(async_await)] #![allow(dead_code)] use std::ops::Add; diff --git a/src/test/ui/async-await/no-args-non-move-async-closure.rs b/src/test/ui/async-await/no-args-non-move-async-closure.rs index 0615f29069203..62d4b3fb6f23b 100644 --- a/src/test/ui/async-await/no-args-non-move-async-closure.rs +++ b/src/test/ui/async-await/no-args-non-move-async-closure.rs @@ -1,6 +1,6 @@ // edition:2018 -#![feature(async_await, async_closure, await_macro)] +#![feature(async_await, async_closure)] fn main() { let _ = async |x: u8| {}; diff --git a/src/test/ui/async-await/recursive-async-impl-trait-type.rs b/src/test/ui/async-await/recursive-async-impl-trait-type.rs index a4e080119345e..54f3339870bda 100644 --- a/src/test/ui/async-await/recursive-async-impl-trait-type.rs +++ b/src/test/ui/async-await/recursive-async-impl-trait-type.rs @@ -2,10 +2,10 @@ // Test that impl trait does not allow creating recursive types that are // otherwise forbidden when using `async` and `await`. -#![feature(await_macro, async_await, generators)] +#![feature(async_await)] async fn recursive_async_function() -> () { //~ ERROR - await!(recursive_async_function()); + recursive_async_function().await; } fn main() {}