Skip to content

Commit dae0b87

Browse files
committed
Add Send + Sync to ArcWake trait to fix unsoundness
1 parent 6a69c0f commit dae0b87

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

futures-util/src/task/arc_wake.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use alloc::sync::Arc;
88
/// can be converted into `Waker` objects.
99
/// Those Wakers can be used to signal executors that a task it owns
1010
/// is ready to be `poll`ed again.
11-
pub trait ArcWake {
11+
// Note: Send + Sync required because `Arc<T>` doesn't automatically imply
12+
// those bounds, but `Waker` implements them.
13+
pub trait ArcWake: Send + Sync {
1214
/// Indicates that the associated task is ready to make progress and should
1315
/// be `poll`ed.
1416
///

0 commit comments

Comments
 (0)