File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -226,28 +226,31 @@ pub(crate) enum Callback<T, U> {
226
226
227
227
impl < T , U > Drop for Callback < T , U > {
228
228
fn drop ( & mut self ) {
229
- // FIXME(nox): What errors do we want here?
230
- let error = crate :: Error :: new_user_dispatch_gone ( ) . with ( if std:: thread:: panicking ( ) {
231
- "user code panicked"
232
- } else {
233
- "runtime dropped the dispatch task"
234
- } ) ;
235
-
236
229
match self {
237
230
Callback :: Retry ( tx) => {
238
231
if let Some ( tx) = tx. take ( ) {
239
- let _ = tx. send ( Err ( ( error , None ) ) ) ;
232
+ let _ = tx. send ( Err ( ( dispatch_gone ( ) , None ) ) ) ;
240
233
}
241
234
}
242
235
Callback :: NoRetry ( tx) => {
243
236
if let Some ( tx) = tx. take ( ) {
244
- let _ = tx. send ( Err ( error ) ) ;
237
+ let _ = tx. send ( Err ( dispatch_gone ( ) ) ) ;
245
238
}
246
239
}
247
240
}
248
241
}
249
242
}
250
243
244
+ #[ cold]
245
+ fn dispatch_gone ( ) -> crate :: Error {
246
+ // FIXME(nox): What errors do we want here?
247
+ crate :: Error :: new_user_dispatch_gone ( ) . with ( if std:: thread:: panicking ( ) {
248
+ "user code panicked"
249
+ } else {
250
+ "runtime dropped the dispatch task"
251
+ } )
252
+ }
253
+
251
254
impl < T , U > Callback < T , U > {
252
255
#[ cfg( feature = "http2" ) ]
253
256
pub ( crate ) fn is_canceled ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments