]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.async2.txt
Auto merge of #84904 - ssomers:btree_drop_kv_in_place, r=Mark-Simulacrum
[rust.git] / src / test / run-make-fulldeps / coverage-reports / expected_show_coverage.async2.txt
1     1|       |// compile-flags: --edition=2018
2     2|       |
3     3|       |use core::{
4     4|       |    future::Future,
5     5|       |    marker::Send,
6     6|       |    pin::Pin,
7     7|       |};
8     8|       |
9     9|      1|fn non_async_func() {
10    10|      1|    println!("non_async_func was covered");
11    11|      1|    let b = true;
12    12|      1|    if b {
13    13|      1|        println!("non_async_func println in block");
14    14|      1|    }
15                    ^0
16    15|      1|}
17    16|       |
18    17|       |
19    18|       |
20    19|       |
21    20|      1|async fn async_func() {
22    21|      1|    println!("async_func was covered");
23    22|      1|    let b = true;
24    23|      1|    if b {
25    24|      1|        println!("async_func println in block");
26    25|      1|    }
27                    ^0
28    26|      1|}
29    27|       |
30    28|       |
31    29|       |
32    30|       |
33    31|      1|async fn async_func_just_println() {
34    32|      1|    println!("async_func_just_println was covered");
35    33|      1|}
36    34|       |
37    35|      1|fn main() {
38    36|      1|    println!("codecovsample::main");
39    37|      1|
40    38|      1|    non_async_func();
41    39|      1|
42    40|      1|    executor::block_on(async_func());
43    41|      1|    executor::block_on(async_func_just_println());
44    42|      1|}
45    43|       |
46    44|       |mod executor {
47    45|       |    use core::{
48    46|       |        future::Future,
49    47|       |        pin::Pin,
50    48|       |        task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
51    49|       |    };
52    50|       |
53    51|      2|    pub fn block_on<F: Future>(mut future: F) -> F::Output {
54    52|      2|        let mut future = unsafe { Pin::new_unchecked(&mut future) };
55    53|      2|        use std::hint::unreachable_unchecked;
56    54|      2|        static VTABLE: RawWakerVTable = RawWakerVTable::new(
57    55|      2|            |_| unsafe { unreachable_unchecked() }, // clone
58                               ^0
59    56|      2|            |_| unsafe { unreachable_unchecked() }, // wake
60                               ^0
61    57|      2|            |_| unsafe { unreachable_unchecked() }, // wake_by_ref
62                               ^0
63    58|      2|            |_| (),
64    59|      2|        );
65    60|      2|        let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
66    61|      2|        let mut context = Context::from_waker(&waker);
67    62|       |
68    63|       |        loop {
69    64|      2|            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
70    65|      2|                break val;
71    66|      0|            }
72    67|       |        }
73    68|      2|    }
74   ------------------
75   | async2::executor::block_on::<core::future::from_generator::GenFuture<async2::async_func::{closure#0}>>:
76   |   51|      1|    pub fn block_on<F: Future>(mut future: F) -> F::Output {
77   |   52|      1|        let mut future = unsafe { Pin::new_unchecked(&mut future) };
78   |   53|      1|        use std::hint::unreachable_unchecked;
79   |   54|      1|        static VTABLE: RawWakerVTable = RawWakerVTable::new(
80   |   55|      1|            |_| unsafe { unreachable_unchecked() }, // clone
81   |   56|      1|            |_| unsafe { unreachable_unchecked() }, // wake
82   |   57|      1|            |_| unsafe { unreachable_unchecked() }, // wake_by_ref
83   |   58|      1|            |_| (),
84   |   59|      1|        );
85   |   60|      1|        let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
86   |   61|      1|        let mut context = Context::from_waker(&waker);
87   |   62|       |
88   |   63|       |        loop {
89   |   64|      1|            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
90   |   65|      1|                break val;
91   |   66|      0|            }
92   |   67|       |        }
93   |   68|      1|    }
94   ------------------
95   | async2::executor::block_on::<core::future::from_generator::GenFuture<async2::async_func_just_println::{closure#0}>>:
96   |   51|      1|    pub fn block_on<F: Future>(mut future: F) -> F::Output {
97   |   52|      1|        let mut future = unsafe { Pin::new_unchecked(&mut future) };
98   |   53|      1|        use std::hint::unreachable_unchecked;
99   |   54|      1|        static VTABLE: RawWakerVTable = RawWakerVTable::new(
100   |   55|      1|            |_| unsafe { unreachable_unchecked() }, // clone
101   |   56|      1|            |_| unsafe { unreachable_unchecked() }, // wake
102   |   57|      1|            |_| unsafe { unreachable_unchecked() }, // wake_by_ref
103   |   58|      1|            |_| (),
104   |   59|      1|        );
105   |   60|      1|        let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) };
106   |   61|      1|        let mut context = Context::from_waker(&waker);
107   |   62|       |
108   |   63|       |        loop {
109   |   64|      1|            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
110   |   65|      1|                break val;
111   |   66|      0|            }
112   |   67|       |        }
113   |   68|      1|    }
114   ------------------
115    69|       |}
116