about summary refs log tree commit diff
path: root/tests/coverage/closure_macro_async.coverage
diff options
context:
space:
mode:
Diffstat (limited to 'tests/coverage/closure_macro_async.coverage')
-rw-r--r--tests/coverage/closure_macro_async.coverage21
1 files changed, 3 insertions, 18 deletions
diff --git a/tests/coverage/closure_macro_async.coverage b/tests/coverage/closure_macro_async.coverage
index 0557ce47d68..a8c72efac66 100644
--- a/tests/coverage/closure_macro_async.coverage
+++ b/tests/coverage/closure_macro_async.coverage
@@ -2,6 +2,9 @@
    LL|       |#![feature(noop_waker)]
    LL|       |//@ edition: 2018
    LL|       |
+   LL|       |//@ aux-build: executor.rs
+   LL|       |extern crate executor;
+   LL|       |
    LL|       |macro_rules! bail {
    LL|       |    ($msg:literal $(,)?) => {
    LL|       |        if $msg.len() > 0 {
@@ -46,22 +49,4 @@
    LL|       |fn main() {
    LL|       |    executor::block_on(test()).unwrap();
    LL|       |}
-   LL|       |
-   LL|       |mod executor {
-   LL|       |    use core::future::Future;
-   LL|       |    use core::pin::pin;
-   LL|       |    use core::task::{Context, Poll, Waker};
-   LL|       |
-   LL|       |    #[coverage(off)]
-   LL|       |    pub fn block_on<F: Future>(mut future: F) -> F::Output {
-   LL|       |        let mut future = pin!(future);
-   LL|       |        let mut context = Context::from_waker(Waker::noop());
-   LL|       |
-   LL|       |        loop {
-   LL|       |            if let Poll::Ready(val) = future.as_mut().poll(&mut context) {
-   LL|       |                break val;
-   LL|       |            }
-   LL|       |        }
-   LL|       |    }
-   LL|       |}