@@ -337,7 +337,7 @@ pub(crate) mod futures_util {
337337 use core:: future:: Future ;
338338 use core:: marker:: Unpin ;
339339 use core:: pin:: Pin ;
340- use core:: task:: { Poll , RawWaker , RawWakerVTable , Waker } ;
340+ use core:: task:: Poll ;
341341 pub ( crate ) struct Selector <
342342 A : Future < Output = ( ) > + Unpin ,
343343 B : Future < Output = ( ) > + Unpin ,
@@ -428,24 +428,6 @@ pub(crate) mod futures_util {
428428 }
429429 }
430430
431- // If we want to poll a future without an async context to figure out if it has completed or
432- // not without awaiting, we need a Waker, which needs a vtable...we fill it with dummy values
433- // but sadly there's a good bit of boilerplate here.
434- fn dummy_waker_clone ( _: * const ( ) ) -> RawWaker {
435- RawWaker :: new ( core:: ptr:: null ( ) , & DUMMY_WAKER_VTABLE )
436- }
437- fn dummy_waker_action ( _: * const ( ) ) { }
438-
439- const DUMMY_WAKER_VTABLE : RawWakerVTable = RawWakerVTable :: new (
440- dummy_waker_clone,
441- dummy_waker_action,
442- dummy_waker_action,
443- dummy_waker_action,
444- ) ;
445- pub ( crate ) fn dummy_waker ( ) -> Waker {
446- unsafe { Waker :: from_raw ( RawWaker :: new ( core:: ptr:: null ( ) , & DUMMY_WAKER_VTABLE ) ) }
447- }
448-
449431 enum JoinerResult < E , F : Future < Output = Result < ( ) , E > > + Unpin > {
450432 Pending ( Option < F > ) ,
451433 Ready ( Result < ( ) , E > ) ,
@@ -558,7 +540,7 @@ pub(crate) mod futures_util {
558540 }
559541}
560542use core:: task;
561- use futures_util:: { dummy_waker , Joiner , OptionalSelector , Selector , SelectorOutput } ;
543+ use futures_util:: { Joiner , OptionalSelector , Selector , SelectorOutput } ;
562544
563545/// Processes background events in a future.
564546///
@@ -950,7 +932,7 @@ where
950932 // below. This will get it moving but won't block us for too long if the underlying
951933 // future is actually async.
952934 use core:: future:: Future ;
953- let mut waker = dummy_waker ( ) ;
935+ let mut waker = task :: Waker :: noop ( ) ;
954936 let mut ctx = task:: Context :: from_waker ( & mut waker) ;
955937 match core:: pin:: Pin :: new ( & mut fut) . poll ( & mut ctx) {
956938 task:: Poll :: Ready ( res) => futures. set_a_res ( res) ,
@@ -1168,7 +1150,7 @@ where
11681150 NETWORK_GRAPH_PERSISTENCE_KEY ,
11691151 network_graph. encode ( ) ,
11701152 )
1171- . await ?;
1153+ . await ?
11721154 }
11731155 Ok ( ( ) )
11741156}
@@ -1178,7 +1160,7 @@ fn check_and_reset_sleeper<
11781160> (
11791161 fut : & mut SleepFuture , mut new_sleeper : impl FnMut ( ) -> SleepFuture ,
11801162) -> Option < bool > {
1181- let mut waker = dummy_waker ( ) ;
1163+ let mut waker = task :: Waker :: noop ( ) ;
11821164 let mut ctx = task:: Context :: from_waker ( & mut waker) ;
11831165 match core:: pin:: Pin :: new ( & mut * fut) . poll ( & mut ctx) {
11841166 task:: Poll :: Ready ( exit) => {
0 commit comments