mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
e96b4e479a
By moving `block_on` to an auxiliary crate, we avoid having to keep a separate copy of it in every async test. (This also incorporates some small tweaks to the headers in `await_ready.rs`.)
20 lines
371 B
Rust
20 lines
371 B
Rust
#![feature(coverage_attribute)]
|
|
#![feature(noop_waker)]
|
|
//@ edition: 2021
|
|
|
|
//@ aux-build: executor.rs
|
|
extern crate executor;
|
|
|
|
fn main() {
|
|
for i in 0..16 {
|
|
let future = async {
|
|
if i >= 12 {
|
|
println!("big");
|
|
} else {
|
|
println!("small");
|
|
}
|
|
};
|
|
executor::block_on(future);
|
|
}
|
|
}
|