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 c4e328560dd..7396918196c 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 778d3ee0c70..5ebb18b999a 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 8db7631ef41..447e40dddd9 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 e94a5f0853d..072b7cea89d 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 f59f1160e70..92f3210ac89 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 c2b59eecb99..dfd8b2e361e 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 708c5704984..2a74485afb4 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 2157cf7d4f7..35a7b40912c 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 ad18f411875..7e3934b8357 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 4572e543f22..6db0e8b8d5f 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 99d87b2273c..3dc4b060633 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 c758244002f..b3b682f7232 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 31e7a65dc98..1b843720102 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 620b0080966..589e260d084 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 0615f290692..62d4b3fb6f2 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 a4e08011934..54f3339870b 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() {}