File tree 5 files changed +8
-3
lines changed
5 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ bytes = { version = "0.6.0", optional = true }
98
98
futures-core = { version = " 0.3.0" , optional = true }
99
99
lazy_static = { version = " 1.0.2" , optional = true }
100
100
memchr = { version = " 2.2" , optional = true }
101
- mio = { version = " 0.7.3 " , optional = true }
101
+ mio = { version = " 0.7.5 " , optional = true }
102
102
num_cpus = { version = " 1.8.0" , optional = true }
103
103
parking_lot = { version = " 0.11.0" , optional = true } # Not in full
104
104
slab = { version = " 0.4.1" , optional = true }
@@ -134,4 +134,4 @@ all-features = true
134
134
rustdoc-args = [" --cfg" , " docsrs" ]
135
135
136
136
[package .metadata .playground ]
137
- features = [" full" ]
137
+ features = [" full" ]
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ const KEEP_ALIVE: Duration = Duration::from_secs(10);
70
70
pub ( crate ) fn spawn_blocking < F , R > ( func : F ) -> JoinHandle < R >
71
71
where
72
72
F : FnOnce ( ) -> R + Send + ' static ,
73
+ R : Send + ' static ,
73
74
{
74
75
let rt = context:: current ( ) . expect ( "not currently running on the Tokio runtime." ) ;
75
76
rt. spawn_blocking ( func)
79
80
pub ( crate ) fn try_spawn_blocking < F , R > ( func : F ) -> Result < ( ) , ( ) >
80
81
where
81
82
F : FnOnce ( ) -> R + Send + ' static ,
83
+ R : Send + ' static ,
82
84
{
83
85
let rt = context:: current ( ) . expect ( "not currently running on the Tokio runtime." ) ;
84
86
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ impl<T> Unpin for BlockingTask<T> {}
19
19
20
20
impl < T , R > Future for BlockingTask < T >
21
21
where
22
- T : FnOnce ( ) -> R ,
22
+ T : FnOnce ( ) -> R + Send + ' static ,
23
+ R : Send + ' static ,
23
24
{
24
25
type Output = R ;
25
26
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ impl Handle {
45
45
pub ( crate ) fn spawn_blocking < F , R > ( & self , func : F ) -> JoinHandle < R >
46
46
where
47
47
F : FnOnce ( ) -> R + Send + ' static ,
48
+ R : Send + ' static ,
48
49
{
49
50
#[ cfg( feature = "tracing" ) ]
50
51
let func = {
Original file line number Diff line number Diff line change @@ -392,6 +392,7 @@ cfg_rt! {
392
392
pub fn spawn_blocking<F , R >( & self , func: F ) -> JoinHandle <R >
393
393
where
394
394
F : FnOnce ( ) -> R + Send + ' static ,
395
+ R : Send + ' static ,
395
396
{
396
397
self . handle. spawn_blocking( func)
397
398
}
You can’t perform that action at this time.
0 commit comments