util: improve impl Send for ReusableBoxFuture docs (#4658)

This commit is contained in:
Alice Ryhl
2022-05-07 22:32:29 +02:00
committed by GitHub
parent 1872a425e2
commit 938b7d6742
+6 -1
View File
@@ -122,7 +122,12 @@ impl<T> Future for ReusableBoxFuture<'_, T> {
}
}
// The future stored inside ReusableBoxFuture<'_, T> must be Send.
// The future stored inside ReusableBoxFuture<'_, T> must be Send since the
// `new` and `set` and `try_set` methods only allow setting the future to Send
// futures.
//
// Note that T is the return type of the future, so its not relevant for
// whether the future itself is Send.
unsafe impl<T> Send for ReusableBoxFuture<'_, T> {}
// The only method called on self.boxed is poll, which takes &mut self, so this