2023-10-26 11:13:32 +00:00
|
|
|
//@ edition:2018
|
|
|
|
|
|
|
|
#![feature(unboxed_closures)]
|
|
|
|
use std::future::Future;
|
|
|
|
|
|
|
|
async fn wrapper<F>(f: F)
|
2023-10-05 01:50:00 +00:00
|
|
|
//~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
|
|
|
//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
2024-02-27 14:57:49 +00:00
|
|
|
//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
2024-03-11 16:57:18 +00:00
|
|
|
//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
2023-10-26 11:13:32 +00:00
|
|
|
where
|
2023-12-07 11:56:48 +00:00
|
|
|
F:,
|
|
|
|
for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a,
|
2023-10-26 11:13:32 +00:00
|
|
|
{
|
2023-10-05 01:50:00 +00:00
|
|
|
//~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32`
|
2023-10-26 11:13:32 +00:00
|
|
|
let mut i = 41;
|
|
|
|
&mut i;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|