1
+ use crate :: fmt:: { self , Debug } ;
1
2
use crate :: future:: Future ;
2
3
use crate :: marker;
3
4
use crate :: pin:: Pin ;
@@ -10,8 +11,7 @@ use crate::task::{Context, Poll};
10
11
/// documentation for more.
11
12
///
12
13
/// [`pending`]: fn.pending.html
13
- #[ unstable( feature = "future_readiness_fns" , issue = "70921" ) ]
14
- #[ derive( Debug ) ]
14
+ #[ stable( feature = "future_readiness_fns" , since = "1.47.0" ) ]
15
15
#[ must_use = "futures do nothing unless you `.await` or poll them" ]
16
16
pub struct Pending < T > {
17
17
_data : marker:: PhantomData < T > ,
@@ -23,7 +23,6 @@ pub struct Pending<T> {
23
23
/// # Examples
24
24
///
25
25
/// ```no_run
26
- /// #![feature(future_readiness_fns)]
27
26
/// use core::future;
28
27
///
29
28
/// # async fn run() {
@@ -32,12 +31,12 @@ pub struct Pending<T> {
32
31
/// unreachable!();
33
32
/// # }
34
33
/// ```
35
- #[ unstable ( feature = "future_readiness_fns" , issue = "70921 " ) ]
34
+ #[ stable ( feature = "future_readiness_fns" , since = "1.47.0 " ) ]
36
35
pub fn pending < T > ( ) -> Pending < T > {
37
36
Pending { _data : marker:: PhantomData }
38
37
}
39
38
40
- #[ unstable ( feature = "future_readiness_fns" , issue = "70921 " ) ]
39
+ #[ stable ( feature = "future_readiness_fns" , since = "1.47.0 " ) ]
41
40
impl < T > Future for Pending < T > {
42
41
type Output = T ;
43
42
@@ -46,10 +45,17 @@ impl<T> Future for Pending<T> {
46
45
}
47
46
}
48
47
49
- #[ unstable ( feature = "future_readiness_fns" , issue = "70921 " ) ]
48
+ #[ stable ( feature = "future_readiness_fns" , since = "1.47.0 " ) ]
50
49
impl < T > Unpin for Pending < T > { }
51
50
52
- #[ unstable( feature = "future_readiness_fns" , issue = "70921" ) ]
51
+ #[ stable( feature = "future_readiness_fns" , since = "1.47.0" ) ]
52
+ impl < T > Debug for Pending < T > {
53
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
54
+ f. debug_struct ( "Pending" ) . finish ( )
55
+ }
56
+ }
57
+
58
+ #[ stable( feature = "future_readiness_fns" , since = "1.47.0" ) ]
53
59
impl < T > Clone for Pending < T > {
54
60
fn clone ( & self ) -> Self {
55
61
pending ( )
0 commit comments