File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,15 @@ pub trait Future {
68
68
/// typically do *not* suffer the same problems of "all wakeups must poll
69
69
/// all events"; they are more like `epoll(4)`.
70
70
///
71
- /// An implementation of `poll` should strive to return quickly, and must
72
- /// *never* block. Returning quickly prevents unnecessarily clogging up
71
+ /// An implementation of `poll` should strive to return quickly, and should
72
+ /// not block. Returning quickly prevents unnecessarily clogging up
73
73
/// threads or event loops. If it is known ahead of time that a call to
74
74
/// `poll` may end up taking awhile, the work should be offloaded to a
75
75
/// thread pool (or something similar) to ensure that `poll` can return
76
76
/// quickly.
77
77
///
78
+ /// An implementation of `poll` may also never cause memory unsafety.
79
+ ///
78
80
/// # Panics
79
81
///
80
82
/// Once a future has completed (returned `Ready` from `poll`),
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ pub struct RawWaker {
29
29
///
30
30
/// The pointer passed to all functions inside the vtable is the `data` pointer
31
31
/// from the enclosing [`RawWaker`] object.
32
+ ///
33
+ /// The functions inside this struct are only intended be called on the `data`
34
+ /// pointer of a properly constructed [`RawWaker`] object from inside the
35
+ /// [`RawWaker`] implementation. Calling one of the contained functions using
36
+ /// any other `data` pointer will cause undefined behavior.
32
37
#[ derive( PartialEq , Copy , Clone , Debug ) ]
33
38
pub struct RawWakerVTable {
34
39
/// This function will be called when the [`RawWaker`] gets cloned, e.g. when
You can’t perform that action at this time.
0 commit comments