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> {
226226
227227impl < T , U > Drop for Callback < T , U > {
228228 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-
236229 match self {
237230 Callback :: Retry ( tx) => {
238231 if let Some ( tx) = tx. take ( ) {
239- let _ = tx. send ( Err ( ( error , None ) ) ) ;
232+ let _ = tx. send ( Err ( ( dispatch_gone ( ) , None ) ) ) ;
240233 }
241234 }
242235 Callback :: NoRetry ( tx) => {
243236 if let Some ( tx) = tx. take ( ) {
244- let _ = tx. send ( Err ( error ) ) ;
237+ let _ = tx. send ( Err ( dispatch_gone ( ) ) ) ;
245238 }
246239 }
247240 }
248241 }
249242}
250243
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+
251254impl < T , U > Callback < T , U > {
252255 #[ cfg( feature = "http2" ) ]
253256 pub ( crate ) fn is_canceled ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments