File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 11use crate :: future:: Future ;
2+ #[ cfg( tokio_unstable) ]
3+ use crate :: runtime:: context:: with_task_hooks;
24use crate :: runtime:: task:: core:: { Cell , Core , Header , Trailer } ;
35use crate :: runtime:: task:: state:: { Snapshot , State } ;
46use crate :: runtime:: task:: waker:: waker_ref;
@@ -153,16 +155,14 @@ where
153155 let res = self . poll_inner ( ) ;
154156
155157 #[ cfg( tokio_unstable) ]
156- self . trailer ( ) . hooks . with_mut ( |ptr| unsafe {
157- ptr. as_mut ( ) . and_then ( |x| {
158- x. as_mut ( ) . map ( |x| {
159- let _ = panic:: catch_unwind ( panic:: AssertUnwindSafe ( || {
160- x. after_poll ( & mut AfterTaskPollContext {
161- _phantom : Default :: default ( ) ,
162- } )
163- } ) ) ;
164- } )
165- } ) ;
158+ let _ = with_task_hooks ( |t| {
159+ if let Some ( hooks) = t {
160+ let _ = panic:: catch_unwind ( panic:: AssertUnwindSafe ( || {
161+ hooks. after_poll ( & mut AfterTaskPollContext {
162+ _phantom : Default :: default ( ) ,
163+ } )
164+ } ) ) ;
165+ }
166166 } ) ;
167167
168168 // We pass our ref-count to `poll_inner`.
You can’t perform that action at this time.
0 commit comments