File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 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};
1212#[ stable( feature = "future_readiness_fns" , since = "1.48.0" ) ]
1313#[ must_use = "futures do nothing unless you `.await` or poll them" ]
1414pub struct Pending < T > {
15- _data : marker:: PhantomData < T > ,
15+ _data : marker:: PhantomData < fn ( ) -> T > ,
1616}
1717
1818/// Creates a future which never resolves, representing a computation that never
@@ -43,9 +43,6 @@ impl<T> Future for Pending<T> {
4343 }
4444}
4545
46- #[ stable( feature = "future_readiness_fns" , since = "1.48.0" ) ]
47- impl < T > Unpin for Pending < T > { }
48-
4946#[ stable( feature = "future_readiness_fns" , since = "1.48.0" ) ]
5047impl < T > Debug for Pending < T > {
5148 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> {
2222 Empty ( marker:: PhantomData )
2323}
2424
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+
2530/// An iterator that yields nothing.
2631///
2732/// This `struct` is created by the [`empty()`] function. See its documentation for more.
2833#[ must_use = "iterators are lazy and do nothing unless consumed" ]
2934#[ 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 > > ) ;
3636
3737#[ stable( feature = "core_impl_debug" , since = "1.9.0" ) ]
3838impl < T > fmt:: Debug for Empty < T > {
You can’t perform that action at this time.
0 commit comments