Skip to content

Commit dd3b033

Browse files
Improve doc comments for FutureObj
1 parent 042928f commit dd3b033

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libcore/future/future_obj.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use mem::PinMut;
1919
use task::{Context, Poll};
2020

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

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

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

141142
/// Drops the future represented by the given void pointer.

0 commit comments

Comments
 (0)