2 #![feature(async_closure)]
3 use std::future::Future;
5 // test the quality of annotations giving lifetimes names (`'1`) when async constructs are involved
7 pub async fn async_fn(x: &mut i32) -> &i32 {
9 *x += 1; //~ ERROR cannot assign to `*x` because it is borrowed
13 pub fn async_closure(x: &mut i32) -> impl Future<Output=&i32> {
16 *x += 1; //~ ERROR cannot assign to `*x` because it is borrowed
21 pub fn async_closure_explicit_return_type(x: &mut i32) -> impl Future<Output=&i32> {
22 (async move || -> &i32 {
24 *x += 1; //~ ERROR cannot assign to `*x` because it is borrowed
29 pub fn async_block(x: &mut i32) -> impl Future<Output=&i32> {
32 *x += 1; //~ ERROR cannot assign to `*x` because it is borrowed