2023-04-20 09:37:15 -05:00
|
|
|
//@run-rustfix
|
2019-09-25 11:30:27 -05:00
|
|
|
|
2022-06-25 17:15:44 -05:00
|
|
|
#![feature(async_closure)]
|
2019-09-25 11:30:27 -05:00
|
|
|
#![warn(clippy::redundant_closure_call)]
|
2023-03-04 10:28:53 -06:00
|
|
|
#![allow(clippy::redundant_async_block)]
|
2019-09-25 11:30:27 -05:00
|
|
|
#![allow(unused)]
|
|
|
|
|
2022-06-25 17:15:44 -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-06-25 17:15:44 -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)();
|
2022-11-29 09:36:43 -06:00
|
|
|
|
|
|
|
macro_rules! m {
|
|
|
|
() => {
|
|
|
|
(|| 0)()
|
|
|
|
};
|
|
|
|
}
|
|
|
|
macro_rules! m2 {
|
|
|
|
() => {
|
|
|
|
(|| m!())()
|
|
|
|
};
|
|
|
|
}
|
|
|
|
m2!();
|
2019-09-25 11:30:27 -05:00
|
|
|
}
|