Skip to content

Commit

Permalink
Improve doc comments for FutureObj
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorBreakfast committed Jul 2, 2018
1 parent 042928f commit dd3b033
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libcore/future/future_obj.rs
Expand Up @@ -19,7 +19,7 @@ use mem::PinMut;
use task::{Context, Poll};

/// A custom trait object for polling futures, roughly akin to
/// `Box<dyn Future<Output = T>>`.
/// `Box<dyn Future<Output = T> + 'a>`.
/// Contrary to `FutureObj`, `LocalFutureObj` does not have a `Send` bound.
pub struct LocalFutureObj<'a, T> {
ptr: *mut (),
Expand Down Expand Up @@ -86,7 +86,7 @@ impl<'a, T> Drop for LocalFutureObj<'a, T> {
}

/// A custom trait object for polling futures, roughly akin to
/// `Box<dyn Future<Output = T>> + Send`.
/// `Box<dyn Future<Output = T> + Send + 'a>`.
pub struct FutureObj<'a, T>(LocalFutureObj<'a, T>);

unsafe impl<'a, T> Send for FutureObj<'a, T> {}
Expand Down Expand Up @@ -135,7 +135,8 @@ pub unsafe trait UnsafeFutureObj<'a, T>: 'a {
///
/// The trait implementor must guarantee that it is safe to repeatedly call
/// `poll` with the result of `into_raw` until `drop` is called; such calls
/// are not, however, allowed to race with each other or with calls to `drop`.
/// are not, however, allowed to race with each other or with calls to
/// `drop`.
unsafe fn poll(ptr: *mut (), cx: &mut Context) -> Poll<T>;

/// Drops the future represented by the given void pointer.
Expand Down

0 comments on commit dd3b033

Please sign in to comment.