Skip to content

Commit f130878

Browse files
Make async closures test use async bound modifier
1 parent 4a2fe44 commit f130878

File tree

8 files changed

+20
-30
lines changed

8 files changed

+20
-30
lines changed

tests/ui/async-await/async-closures/async-fn-mut-for-async-fn.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
// FIXME(async_closures): When `fn_sig_for_fn_abi` is fixed, remove this.
66
// ignore-pass (test emits codegen-time warnings)
77

8-
#![feature(async_closure, async_fn_traits)]
8+
#![feature(async_closure)]
99

1010
extern crate block_on;
1111

12-
use std::ops::AsyncFnMut;
13-
1412
fn main() {
1513
block_on::block_on(async {
1614
let x = async || {};
1715

18-
async fn needs_async_fn_mut(mut x: impl AsyncFnMut()) {
16+
async fn needs_async_fn_mut(mut x: impl async FnMut()) {
1917
x().await;
2018
}
2119
needs_async_fn_mut(x).await;

tests/ui/async-await/async-closures/async-fn-once-for-async-fn.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
// FIXME(async_closures): When `fn_sig_for_fn_abi` is fixed, remove this.
66
// ignore-pass (test emits codegen-time warnings)
77

8-
#![feature(async_closure, async_fn_traits)]
8+
#![feature(async_closure)]
99

1010
extern crate block_on;
1111

12-
use std::ops::AsyncFnOnce;
13-
1412
fn main() {
1513
block_on::block_on(async {
1614
let x = async || {};
1715

18-
async fn needs_async_fn_once(x: impl AsyncFnOnce()) {
16+
async fn needs_async_fn_once(x: impl async FnOnce()) {
1917
x().await;
2018
}
2119
needs_async_fn_once(x).await;

tests/ui/async-await/async-closures/auxiliary/block-on.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// edition: 2021
22

3-
#![feature(async_closure, noop_waker, async_fn_traits)]
3+
#![feature(async_closure, noop_waker)]
44

55
use std::future::Future;
66
use std::pin::pin;

tests/ui/async-await/async-closures/brand.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
// edition:2021
33
// build-pass
44

5-
#![feature(async_closure, async_fn_traits)]
5+
#![feature(async_closure)]
66

77
extern crate block_on;
88

99
use std::future::Future;
1010
use std::marker::PhantomData;
11-
use std::ops::AsyncFn;
1211

1312
struct S;
1413
struct B<'b>(PhantomData<&'b mut &'b mut ()>);
1514

1615
impl S {
17-
async fn q<F: AsyncFn(B<'_>)>(self, f: F) {
16+
async fn q<F: async Fn(B<'_>)>(self, f: F) {
1817
f(B(PhantomData)).await;
1918
}
2019
}

tests/ui/async-await/async-closures/drop.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
// run-pass
44
// check-run-results
55

6-
#![feature(async_closure, async_fn_traits)]
6+
#![feature(async_closure)]
77
#![allow(unused)]
88

99
extern crate block_on;
1010

11-
use std::ops::AsyncFnOnce;
12-
1311
struct DropMe(i32);
1412

1513
impl Drop for DropMe {
@@ -18,7 +16,7 @@ impl Drop for DropMe {
1816
}
1917
}
2018

21-
async fn call_once(f: impl AsyncFnOnce()) {
19+
async fn call_once(f: impl async FnOnce()) {
2220
println!("before call");
2321
let fut = Box::pin(f());
2422
println!("after call");

tests/ui/async-await/async-closures/mangle.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@
88
// FIXME(async_closures): When `fn_sig_for_fn_abi` is fixed, remove this.
99
// ignore-pass (test emits codegen-time warnings)
1010

11-
#![feature(async_closure, noop_waker, async_fn_traits)]
11+
#![feature(async_closure, noop_waker)]
1212

1313