diff --git a/library/core/src/future/pending.rs b/library/core/src/future/pending.rs index 560dd25ecff..2877e66eca8 100644 --- a/library/core/src/future/pending.rs +++ b/library/core/src/future/pending.rs @@ -12,7 +12,7 @@ use crate::task::{Context, Poll}; #[stable(feature = "future_readiness_fns", since = "1.48.0")] #[must_use = "futures do nothing unless you `.await` or poll them"] pub struct Pending { - _data: marker::PhantomData, + _data: marker::PhantomData T>, } /// Creates a future which never resolves, representing a computation that never @@ -43,9 +43,6 @@ impl Future for Pending { } } -#[stable(feature = "future_readiness_fns", since = "1.48.0")] -impl Unpin for Pending {} - #[stable(feature = "future_readiness_fns", since = "1.48.0")] impl Debug for Pending { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/library/core/src/iter/sources/empty.rs b/library/core/src/iter/sources/empty.rs index 7abe01d17c9..98734c527f2 100644 --- a/library/core/src/iter/sources/empty.rs +++ b/library/core/src/iter/sources/empty.rs @@ -22,17 +22,17 @@ pub const fn empty() -> Empty { Empty(marker::PhantomData) } +// Newtype for use in `PhantomData` to avoid +// > error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]` +// in `const fn empty()` above. +struct FnReturning(fn() -> T); + /// An iterator that yields nothing. /// /// This `struct` is created by the [`empty()`] function. See its documentation for more. #[must_use = "iterators are lazy and do nothing unless consumed"] #[stable(feature = "iter_empty", since = "1.2.0")] -pub struct Empty(marker::PhantomData); - -#[stable(feature = "iter_empty_send_sync", since = "1.42.0")] -unsafe impl Send for Empty {} -#[stable(feature = "iter_empty_send_sync", since = "1.42.0")] -unsafe impl Sync for Empty {} +pub struct Empty(marker::PhantomData>); #[stable(feature = "core_impl_debug", since = "1.9.0")] impl fmt::Debug for Empty {