2019-09-25 16:30:27 +00:00
|
|
|
// run-rustfix
|
|
|
|
|
2022-08-11 17:42:16 +00:00
|
|
|
#![feature(async_closure)]
|
2019-09-25 16:30:27 +00:00
|
|
|
#![warn(clippy::redundant_closure_call)]
|
|
|
|
#![allow(unused)]
|
|
|
|
|
2022-08-11 17:42:16 +00:00
|
|
|
async fn something() -> u32 {
|
|
|
|
21
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn something_else() -> u32 {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
|
2019-09-25 16:30:27 +00:00
|
|
|
fn main() {
|
|
|
|
let a = (|| 42)();
|
2022-08-11 17:42:16 +00:00
|
|
|
let b = (async || {
|
|
|
|
let x = something().await;
|
|
|
|
let y = something_else().await;
|
|
|
|
x * y
|
|
|
|
})();
|
|
|
|
let c = (|| {
|
|
|
|
let x = 21;
|
|
|
|
let y = 2;
|
|
|
|
x * y
|
|
|
|
})();
|
|
|
|
let d = (async || something().await)();
|
2019-09-25 16:30:27 +00:00
|
|
|
}
|