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 {
6868 /// typically do *not* suffer the same problems of "all wakeups must poll
6969 /// all events"; they are more like `epoll(4)`.
7070 ///
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
7373 /// threads or event loops. If it is known ahead of time that a call to
7474 /// `poll` may end up taking awhile, the work should be offloaded to a
7575 /// thread pool (or something similar) to ensure that `poll` can return
7676 /// quickly.
7777 ///
78+ /// An implementation of `poll` may also never cause memory unsafety.
79+ ///
7880 /// # Panics
7981 ///
8082 /// 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 {
2929///
3030/// The pointer passed to all functions inside the vtable is the `data` pointer
3131/// 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.
3237#[ derive( PartialEq , Copy , Clone , Debug ) ]
3338pub struct RawWakerVTable {
3439 /// 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