File tree 2 files changed +7
-10
lines changed
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use crate::task::{Context, Poll};
12
12
#[ stable( feature = "future_readiness_fns" , since = "1.48.0" ) ]
13
13
#[ must_use = "futures do nothing unless you `.await` or poll them" ]
14
14
pub struct Pending < T > {
15
- _data : marker:: PhantomData < T > ,
15
+ _data : marker:: PhantomData < fn ( ) -> T > ,
16
16
}
17
17
18
18
/// Creates a future which never resolves, representing a computation that never
@@ -43,9 +43,6 @@ impl<T> Future for Pending<T> {
43
43
}
44
44
}
45
45
46
- #[ stable( feature = "future_readiness_fns" , since = "1.48.0" ) ]
47
- impl < T > Unpin for Pending < T > { }
48
-
49
46
#[ stable( feature = "future_readiness_fns" , since = "1.48.0" ) ]
50
47
impl < T > Debug for Pending < T > {
51
48
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ pub const fn empty<T>() -> Empty<T> {
22
22
Empty ( marker:: PhantomData )
23
23
}
24
24
25
+ // Newtype for use in `PhantomData` to avoid
26
+ // > error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]`
27
+ // in `const fn empty<T>()` above.
28
+ struct FnReturning < T > ( fn ( ) -> T ) ;
29
+
25
30
/// An iterator that yields nothing.
26
31
///
27
32
/// This `struct` is created by the [`empty()`] function. See its documentation for more.
28
33
#[ must_use = "iterators are lazy and do nothing unless consumed" ]
29
34
#[ stable( feature = "iter_empty" , since = "1.2.0" ) ]
30
- pub struct Empty < T > ( marker:: PhantomData < T > ) ;
31
-
32
- #[ stable( feature = "iter_empty_send_sync" , since = "1.42.0" ) ]
33
- unsafe impl < T > Send for Empty < T > { }
34
- #[ stable( feature = "iter_empty_send_sync" , since = "1.42.0" ) ]
35
- unsafe impl < T > Sync for Empty < T > { }
35
+ pub struct Empty < T > ( marker:: PhantomData < FnReturning < T > > ) ;
36
36
37
37
#[ stable( feature = "core_impl_debug" , since = "1.9.0" ) ]
38
38
impl < T > fmt:: Debug for Empty < T > {
You can’t perform that action at this time.
0 commit comments