From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/coverage/closure_macro_async.rs | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'tests/coverage/closure_macro_async.rs') diff --git a/tests/coverage/closure_macro_async.rs b/tests/coverage/closure_macro_async.rs index b4275599e..a7f0cabb4 100644 --- a/tests/coverage/closure_macro_async.rs +++ b/tests/coverage/closure_macro_async.rs @@ -1,5 +1,6 @@ -// compile-flags: --edition=2018 #![feature(coverage_attribute)] +#![feature(noop_waker)] +// edition: 2018 macro_rules! bail { ($msg:literal $(,)?) => { @@ -45,27 +46,14 @@ fn main() { } mod executor { - use core::{ - future::Future, - pin::Pin, - task::{Context, Poll, RawWaker, RawWakerVTable, Waker}, - }; + use core::future::Future; + use core::pin::pin; + use core::task::{Context, Poll, Waker}; #[coverage(off)] pub fn block_on(mut future: F) -> F::Output { - let mut future = unsafe { Pin::new_unchecked(&mut future) }; - use std::hint::unreachable_unchecked; - static VTABLE: RawWakerVTable = RawWakerVTable::new( - #[coverage(off)] - |_| unsafe { unreachable_unchecked() }, // clone - #[coverage(off)] - |_| unsafe { unreachable_unchecked() }, // wake - #[coverage(off)] - |_| unsafe { unreachable_unchecked() }, // wake_by_ref - #[coverage(off)] - |_| (), - ); - let waker = unsafe { Waker::from_raw(RawWaker::new(core::ptr::null(), &VTABLE)) }; + let mut future = pin!(future); + let waker = Waker::noop(); let mut context = Context::from_waker(&waker); loop { -- cgit v1.2.3