@@ -16,12 +16,14 @@ pub use core::future::*;
16
16
///
17
17
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
18
18
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
19
+ #[ doc( hidden) ]
19
20
#[ unstable( feature = "gen_future" , issue = "50547" ) ]
20
21
pub fn from_generator < T : Generator < Yield = ( ) > > ( x : T ) -> impl Future < Output = T :: Return > {
21
22
GenFuture ( x)
22
23
}
23
24
24
25
/// A wrapper around generators used to implement `Future` for `async`/`await` code.
26
+ #[ doc( hidden) ]
25
27
#[ unstable( feature = "gen_future" , issue = "50547" ) ]
26
28
#[ derive( Copy , Clone , Debug , Eq , PartialEq , Ord , PartialOrd , Hash ) ]
27
29
struct GenFuture < T : Generator < Yield = ( ) > > ( T ) ;
@@ -30,6 +32,7 @@ struct GenFuture<T: Generator<Yield = ()>>(T);
30
32
// self-referential borrows in the underlying generator.
31
33
impl < T : Generator < Yield = ( ) > > !Unpin for GenFuture < T > { }
32
34
35
+ #[ doc( hidden) ]
33
36
#[ unstable( feature = "gen_future" , issue = "50547" ) ]
34
37
impl < T : Generator < Yield = ( ) > > Future for GenFuture < T > {
35
38
type Output = T :: Return ;
@@ -57,6 +60,7 @@ impl Drop for SetOnDrop {
57
60
}
58
61
}
59
62
63
+ #[ doc( hidden) ]
60
64
#[ unstable( feature = "gen_future" , issue = "50547" ) ]
61
65
/// Sets the thread-local task context used by async/await futures.
62
66
pub fn set_task_context < F , R > ( cx : & mut Context < ' _ > , f : F ) -> R
74
78
f ( )
75
79
}
76
80
81
+ #[ doc( hidden) ]
77
82
#[ unstable( feature = "gen_future" , issue = "50547" ) ]
78
83
/// Retrieves the thread-local task context used by async/await futures.
79
84
///
@@ -105,6 +110,7 @@ where
105
110
unsafe { f ( cx_ptr. as_mut ( ) ) }
106
111
}
107
112
113
+ #[ doc( hidden) ]
108
114
#[ unstable( feature = "gen_future" , issue = "50547" ) ]
109
115
/// Polls a future in the current thread-local task waker.
110
116
pub fn poll_with_tls_context < F > ( f : Pin < & mut F > ) -> Poll < F :: Output >
0 commit comments