@@ -9,9 +9,9 @@ use core::{
9
9
/// A custom trait object for polling futures, roughly akin to
10
10
/// `Box<dyn Future<Output = T> + 'a>`.
11
11
///
12
- /// This custom trait object was introduced for two reasons:
13
- /// - Currently it is not possible to take ` dyn Trait` by value and
14
- /// `Box<dyn Trait>` is not available in no_std contexts.
12
+ /// This custom trait object was introduced as currently it is not possible to
13
+ /// take `dyn Trait` by value and `Box< dyn Trait>` is not available in no_std
14
+ /// contexts.
15
15
pub struct LocalFutureObj < ' a , T > {
16
16
ptr : * mut ( ) ,
17
17
poll_fn : unsafe fn ( * mut ( ) , & mut Context < ' _ > ) -> Poll < T > ,
@@ -79,14 +79,13 @@ impl<'a, T> Drop for LocalFutureObj<'a, T> {
79
79
/// A custom trait object for polling futures, roughly akin to
80
80
/// `Box<dyn Future<Output = T> + Send + 'a>`.
81
81
///
82
- /// This custom trait object was introduced for two reasons:
83
- /// - Currently it is not possible to take `dyn Trait` by value and
84
- /// `Box<dyn Trait>` is not available in no_std contexts.
85
- /// - The `Future` trait is currently not object safe: The `Future::poll`
86
- /// method makes uses the arbitrary self types feature and traits in which
87
- /// this feature is used are currently not object safe due to current compiler
88
- /// limitations. (See tracking issue for arbitrary self types for more
89
- /// information #44874)
82
+ /// This custom trait object was introduced as currently it is not possible to
83
+ /// take `dyn Trait` by value and `Box<dyn Trait>` is not available in no_std
84
+ /// contexts.
85
+ ///
86
+ /// You should generally not need to use this type outside of `no_std` or when
87
+ /// implementing `Spawn`, consider using [`BoxFuture`](crate::future::BoxFuture)
88
+ /// instead.
90
89
pub struct FutureObj < ' a , T > ( LocalFutureObj < ' a , T > ) ;
91
90
92
91
impl < ' a , T > Unpin for FutureObj < ' a , T > { }
0 commit comments