From dd3b0337ff22260ef9dfc1bfcf58bd18386d4cbe Mon Sep 17 00:00:00 2001 From: Josef Reinhard Brandl Date: Sun, 1 Jul 2018 14:58:40 +0200 Subject: [PATCH] Improve doc comments for `FutureObj` --- src/libcore/future/future_obj.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcore/future/future_obj.rs b/src/libcore/future/future_obj.rs index 67bd3de98c1a..b42fd2b5bd7a 100644 --- a/src/libcore/future/future_obj.rs +++ b/src/libcore/future/future_obj.rs @@ -19,7 +19,7 @@ use mem::PinMut; use task::{Context, Poll}; /// A custom trait object for polling futures, roughly akin to -/// `Box>`. +/// `Box + 'a>`. /// Contrary to `FutureObj`, `LocalFutureObj` does not have a `Send` bound. pub struct LocalFutureObj<'a, T> { ptr: *mut (), @@ -86,7 +86,7 @@ impl<'a, T> Drop for LocalFutureObj<'a, T> { } /// A custom trait object for polling futures, roughly akin to -/// `Box> + Send`. +/// `Box + Send + 'a>`. pub struct FutureObj<'a, T>(LocalFutureObj<'a, T>); unsafe impl<'a, T> Send for FutureObj<'a, T> {} @@ -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; /// Drops the future represented by the given void pointer.