2019-09-25 11:30:27 -05:00
|
|
|
// run-rustfix
|
|
|
|
|
2022-08-11 12:42:16 -05:00
|
|
|
#![feature(async_closure)]
|
2019-09-25 11:30:27 -05:00
|
|
|
#![warn(clippy::redundant_closure_call)]
|
|
|
|
#![allow(unused)]
|
|
|
|
|
2022-08-11 12:42:16 -05:00
|
|
|
async fn something() -> u32 {
|
|
|
|
21
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn something_else() -> u32 {
|
|
|
|
2
|
|
|
|
}
|
|
|
|
|
2019-09-25 11:30:27 -05:00
|
|
|
fn main() {
|
|
|
|
let a = 42;
|
2022-08-11 12:42:16 -05: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 11:30:27 -05:00
|
|
|
}
|