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