rust/tests/source/async_block.rs

52 lines
668 B
Rust
Raw Normal View History

// rustfmt-edition: 2018
2018-07-29 15:45:31 +00:00
fn main() {
let x = async {
Ok(())
};
}
2018-07-30 00:20:11 +00:00
fn baz() {
// test
let x = async {
// async blocks are great
Ok(())
};
let y = async {
Ok(())
}; // comment
2019-03-20 17:18:02 +00:00
spawn(
a,
async move {
action();
Ok(())
},
);
spawn(
a,
async move || {
action();
Ok(())
},
);
spawn(
a,
static async || {
action();
Ok(())
},
);
spawn(
a,
static async move || {
action();
Ok(())
},
);
2018-07-30 00:20:11 +00:00
}