Skip to content

Commit a0493aa

Browse files
authored
Rollup merge of rust-lang#62324 - Centril:reduce-await-macro-reliance, r=cramertj
Reduce reliance on `await!(...)` macro Only the last commit is new. r? @cramertj
2 parents 566909b + 3eef0cb commit a0493aa

16 files changed

+30
-30
lines changed

src/test/run-pass/async-await/async-fn-size.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition:2018
22

3-
#![feature(async_await, await_macro)]
3+
#![feature(async_await)]
44

55
#[path = "../auxiliary/arc_wake.rs"]
66
mod arc_wake;
@@ -58,31 +58,31 @@ fn wait(fut: impl Future<Output = u8>) -> u8 {
5858
fn base() -> WakeOnceThenComplete { WakeOnceThenComplete(false, 1) }
5959

6060
async fn await1_level1() -> u8 {
61-
await!(base())
61+
base().await
6262
}
6363

6464
async fn await2_level1() -> u8 {
65-
await!(base()) + await!(base())
65+
base().await + base().await
6666
}
6767

6868
async fn await3_level1() -> u8 {
69-
await!(base()) + await!(base()) + await!(base())
69+
base().await + base().await + base().await
7070
}
7171

7272
async fn await3_level2() -> u8 {
73-
await!(await3_level1()) + await!(await3_level1()) + await!(await3_level1())
73+
await3_level1().await + await3_level1().await + await3_level1().await
7474
}
7575

7676
async fn await3_level3() -> u8 {
77-
await!(await3_level2()) + await!(await3_level2()) + await!(await3_level2())
77+
await3_level2().await + await3_level2().await + await3_level2().await
7878
}
7979

8080
async fn await3_level4() -> u8 {
81-
await!(await3_level3()) + await!(await3_level3()) + await!(await3_level3())
81+
await3_level3().await + await3_level3().await + await3_level3().await
8282
}
8383

8484
async fn await3_level5() -> u8 {
85-
await!(await3_level4()) + await!(await3_level4()) + await!(await3_level4())
85+
await3_level4().await + await3_level4().await + await3_level4().await
8686
}
8787

8888
fn main() {

src/test/run-pass/async-await/issue-60709.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// handled incorrectly in generators.
33
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
44

5-
#![feature(async_await, await_macro)]
5+
#![feature(async_await)]
66
#![allow(unused)]
77

88
use std::future::Future;
@@ -22,7 +22,7 @@ impl Future for Never {
2222
fn main() {
2323
let fut = async {
2424
let _rc = Rc::new(()); // Also crashes with Arc
25-
await!(Never());
25+
Never().await;
2626
};
2727
let _bla = fut; // Moving the future is required.
2828
}

src/test/ui/async-await/async-fn-path-elision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition:2018
22

3-
#![feature(async_await, await_macro)]
3+
#![feature(async_await)]
44
#![allow(dead_code)]
55

66
struct HasLifetime<'a>(&'a bool);

src/test/ui/async-await/async-with-closure.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22
// edition:2018
33

4-
#![feature(async_await, await_macro)]
4+
#![feature(async_await)]
55

66
trait MyClosure {
77
type Args;
@@ -20,7 +20,7 @@ async fn get_future<C: ?Sized + MyClosure>(_stream: MyStream<C>) {}
2020

2121
async fn f() {
2222
let messages: MyStream<dyn FnMut()> = unimplemented!();
23-
await!(get_future(messages));
23+
get_future(messages).await;
2424
}
2525

2626
fn main() {}

src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// edition:2018
22

33
#![allow(non_camel_case_types)]
4-
#![feature(async_await, await_macro)]
4+
#![feature(async_await)]
55

66
mod outer_mod {
77
pub mod await { //~ ERROR expected identifier, found reserved keyword `await`

src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters-by-ref-binding.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// run-pass
44

55
#![allow(unused_variables)]
6-
#![feature(async_await, await_macro)]
6+
#![feature(async_await)]
77

88
// Test that the drop order for parameters in a fn and async fn matches up. Also test that
99
// parameters (used or unused) are not dropped until the async fn completes execution.

src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// run-pass
44

55
#![allow(unused_variables)]
6-
#![feature(async_await, await_macro)]
6+
#![feature(async_await)]
77

88
// Test that the drop order for parameters in a fn and async fn matches up. Also test that
99
// parameters (used or unused) are not dropped until the async fn completes execution.

src/test/ui/async-await/issues/issue-53249.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22
// edition:2018
33

4-
#![feature(arbitrary_self_types, async_await, await_macro)]
4+
#![feature(arbitrary_self_types, async_await)]
55

66
use std::task::{self, Poll};
77
use std::future::Future;
@@ -37,11 +37,11 @@ impl<R, F> Future for Lazy<F>
3737
async fn __receive<WantFn, Fut>(want: WantFn) -> ()
3838
where Fut: Future<Output = ()>, WantFn: Fn(&Box<dyn Send + 'static>) -> Fut,
3939
{
40-
await!(lazy(|_| ()));
40+
lazy(|_| ()).await;
4141
}
4242

4343
pub fn basic_spawn_receive() {
44-
async { await!(__receive(|_| async { () })) };
44+
async { __receive(|_| async { () }).await };
4545
}
4646

4747
fn main() {}

src/test/ui/async-await/issues/issue-54974.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22
// edition:2018
33

4-
#![feature(async_await, await_macro)]
4+
#![feature(async_await)]
55

66
use std::sync::Arc;
77

src/test/ui/async-await/issues/issue-55324.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22
// edition:2018
33

4-
#![feature(async_await, await_macro)]
4+
#![feature(async_await)]
55

66
use std::future::Future;
77

88
#[allow(unused)]
99
async fn foo<F: Future<Output = i32>>(x: &i32, future: F) -> i32 {
10-
let y = await!(future);
10+
let y = future.await;
1111
*x + y
1212
}
1313

src/test/ui/async-await/issues/issue-58885.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22
// edition:2018
33

4-
#![feature(async_await, await_macro)]
4+
#![feature(async_await)]
55

66
struct Xyz {
77
a: u64,

src/test/ui/async-await/issues/issue-59001.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// build-pass (FIXME(62277): could be check-pass?)
22
// edition:2018
33

4-
#![feature(async_await, await_macro)]
4+
#![feature(async_await)]
55

66
use std::future::Future;
77

src/test/ui/async-await/issues/issue-59972.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// compile-flags: --edition=2018
44

5-
#![feature(async_await, await_macro)]
5+
#![feature(async_await)]
66

77
pub enum Uninhabited { }
88

@@ -15,7 +15,7 @@ async fn noop() { }
1515
#[allow(unused)]
1616
async fn contains_never() {
1717
let error = uninhabited_async();
18-
await!(noop());
18+
noop().await;
1919
let error2 = error;
2020
}
2121

src/test/ui/async-await/multiple-lifetimes/hrtb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Test that we can use async fns with multiple arbitrary lifetimes.
55

6-
#![feature(arbitrary_self_types, async_await, await_macro)]
6+
#![feature(async_await)]
77
#![allow(dead_code)]
88

99
use std::ops::Add;

src/test/ui/async-await/no-args-non-move-async-closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition:2018
22

3-
#![feature(async_await, async_closure, await_macro)]
3+
#![feature(async_await, async_closure)]
44

55
fn main() {
66
let _ = async |x: u8| {};

src/test/ui/async-await/recursive-async-impl-trait-type.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// Test that impl trait does not allow creating recursive types that are
33
// otherwise forbidden when using `async` and `await`.
44

5-
#![feature(await_macro, async_await, generators)]
5+
#![feature(async_await)]
66

77
async fn recursive_async_function() -> () { //~ ERROR
8-
await!(recursive_async_function());
8+
recursive_async_function().await;
99
}
1010

1111
fn main() {}

0 commit comments

Comments
 (0)