1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
//@ edition: 2021
#![deny(closure_returning_async_block)]
fn main() {
let x = || async {};
//~^ ERROR closure returning async block can be made into an async closure
let x = || async move {};
//~^ ERROR closure returning async block can be made into an async closure
let x = move || async move {};
//~^ ERROR closure returning async block can be made into an async closure
let x = move || async {};
//~^ ERROR closure returning async block can be made into an async closure
let x = || {{ async {} }};
//~^ ERROR closure returning async block can be made into an async closure
}
|