]> git.lizzy.rs Git - rust.git/blob - src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.async2.txt
Rollup merge of #85174 - GuillaumeGomez:doc-code-block-border-radius, r=jsha
[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    15|      1|}
16    16|       |
17    17|       |
18    18|       |
19    19|       |
20    20|      1|async fn async_func() {
21    21|      1|    println!("async_func was covered");
22    22|      1|    let b = true;
23    23|      1|    if b {
24    24|      1|        println!("async_func println in block");
25    25|      1|    }
26                    ^0
27    26|      1|}
28    27|       |
29    28|       |
30    29|       |
31    30|       |
32    31|      1|async fn async_func_just_println() {
33    32|      1|    println!("async_func_just_println was covered");
34    33|      1|}
35    34|       |
36    35|      1|fn main() {
37    36|      1|    println!("codecovsample::main");
38    37|      1|
39    38|      1|    non_async_func();
40    39|      1|
41    40|      1|    executor::block_on(async_func());
42    41|      1|    executor::block_on(async_func_just_println());
43    42|      1|}
44    43|       |
45    44|       |mod executor {
46    45|       |    use core::{
47    46|       |        future::Future,
48    47|       |        pin::Pin,
49    48|       |        task::{Context, Poll, RawWaker, RawWakerVTable, Waker},
50    49|       |    };
51    50|       |
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
57                               ^0
58    56|      2|            |_| unsafe { unreachable_unchecked() }, // wake
59                               ^0
60    57|      2|            |_| unsafe { unreachable_unchecked() }, // wake_by_ref
61                               ^0
62    58|      2|            |_| (),
63    59|      2|        );
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);
66    62|       |
67    63|       |        loop {
68    64|      2|            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
69    65|      2|                break val;
70    66|      0|            }
71    67|       |        }
72    68|      2|    }
73   ------------------
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
82   |   58|      1|            |_| (),
83   |   59|      1|        );
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);
86   |   62|       |
87   |   63|       |        loop {
88   |   64|      1|            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
89   |   65|      1|                break val;
90   |   66|      0|            }
91   |   67|       |        }
92   |   68|      1|    }
93   ------------------
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
102   |   58|      1|            |_| (),
103   |   59|      1|        );
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);
106   |   62|       |
107   |   63|       |        loop {
108   |   64|      1|            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
109   |   65|      1|                break val;
110   |   66|      0|            }
111   |   67|       |        }
112   |   68|      1|    }
113   ------------------
114    69|       |}
115