2024-09-05 19:52:32 -05:00
|
|
|
LL| |#![feature(coverage_attribute)]
|
|
|
|
LL| |#![feature(noop_waker)]
|
2024-09-06 00:41:10 -05:00
|
|
|
LL| |#![coverage(off)]
|
2024-09-05 19:52:32 -05:00
|
|
|
LL| |//@ edition: 2021
|
|
|
|
LL| |
|
2024-09-06 00:41:10 -05:00
|
|
|
LL| |//@ aux-build: executor.rs
|
|
|
|
LL| |extern crate executor;
|
2024-09-05 19:52:32 -05:00
|
|
|
LL| |
|
2024-09-06 00:41:10 -05:00
|
|
|
LL| |async fn ready() -> u8 {
|
|
|
|
LL| | 1
|
|
|
|
LL| |}
|
|
|
|
LL| |
|
|
|
|
LL| |#[coverage(on)]
|
|
|
|
LL| |#[rustfmt::skip]
|
2024-09-05 19:52:32 -05:00
|
|
|
LL| 1|async fn await_ready() -> u8 {
|
2024-09-05 17:25:25 -05:00
|
|
|
LL| 1| // await should be covered even if the function never yields
|
2024-09-05 19:52:32 -05:00
|
|
|
LL| 1| ready()
|
2024-09-05 17:25:25 -05:00
|
|
|
LL| 1| .await
|
2024-09-05 19:52:32 -05:00
|
|
|
LL| 1|}
|
|
|
|
LL| |
|
2024-09-06 00:41:10 -05:00
|
|
|
LL| |fn main() {
|
|
|
|
LL| | let mut future = Box::pin(await_ready());
|
|
|
|
LL| | executor::block_on(future.as_mut());
|
2024-09-05 19:52:32 -05:00
|
|
|
LL| |}
|
|
|
|
|