1 1| |// compile-flags: --edition=2018
9 9| 1|fn non_async_func() {
10 10| 1| println!("non_async_func was covered");
13 13| 1| println!("non_async_func println in block");
20 20| 1|async fn async_func() {
21 21| 1| println!("async_func was covered");
24 24| 1| println!("async_func println in block");
32 31| 1|async fn async_func_just_println() {
33 32| 1| println!("async_func_just_println was covered");
37 36| 1| println!("codecovsample::main");
39 38| 1| non_async_func();
41 40| 1| executor::block_on(async_func());
42 41| 1| executor::block_on(async_func_just_println());
49 48| | task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
52 51| 2| pub fn block_on<F: Future>(mut future: F) -> F::Output {
53 52| 2| let mut future = unsafe { Pin::new_unchecked(&mut future) };
54 53| 2| use std::hint::unreachable_unchecked;
55 54| 2| static VTABLE: RawWakerVTable = RawWakerVTable::new(
56 55| 2| |_| unsafe { unreachable_unchecked() }, // clone
58 56| 2| |_| unsafe { unreachable_unchecked() }, // wake
60 57| 2| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
64 60| 2| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
65 61| 2| let mut context = Context::from_waker(&waker);
68 64| 2| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
74 | async2::executor::block_on::<core::future::from_generator::GenFuture<async2::async_func::{closure#0}>>:
75 | 51| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output {
76 | 52| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) };
77 | 53| 1| use std::hint::unreachable_unchecked;
78 | 54| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new(
79 | 55| 1| |_| unsafe { unreachable_unchecked() }, // clone
80 | 56| 1| |_| unsafe { unreachable_unchecked() }, // wake
81 | 57| 1| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
84 | 60| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
85 | 61| 1| let mut context = Context::from_waker(&waker);
88 | 64| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
94 | async2::executor::block_on::<core::future::from_generator::GenFuture<async2::async_func_just_println::{closure#0}>>:
95 | 51| 1| pub fn block_on<F: Future>(mut future: F) -> F::Output {
96 | 52| 1| let mut future = unsafe { Pin::new_unchecked(&mut future) };
97 | 53| 1| use std::hint::unreachable_unchecked;
98 | 54| 1| static VTABLE: RawWakerVTable = RawWakerVTable::new(
99 | 55| 1| |_| unsafe { unreachable_unchecked() }, // clone
100 | 56| 1| |_| unsafe { unreachable_unchecked() }, // wake
101 | 57| 1| |_| unsafe { unreachable_unchecked() }, // wake_by_ref
104 | 60| 1| let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
105 | 61| 1| let mut context = Context::from_waker(&waker);
108 | 64| 1| if let Poll::Ready(val) = future.as_mut().poll(&mut context) {