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 @@ #[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 @@ fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { } } -#[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/hash/mod.rs b/library/core/src/hash/mod.rs index 3ff84cc9672..53de8b42c05 100644 --- a/library/core/src/hash/mod.rs +++ b/library/core/src/hash/mod.rs @@ -602,7 +602,7 @@ fn hash_one(&self, x: T) -> u64 /// [`HashSet`]: ../../std/collections/struct.HashSet.html /// [zero-sized]: https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts #[stable(since = "1.7.0", feature = "build_hasher")] -pub struct BuildHasherDefault(marker::PhantomData); +pub struct BuildHasherDefault(marker::PhantomData H>); #[stable(since = "1.9.0", feature = "core_impl_debug")] impl fmt::Debug for BuildHasherDefault { 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 {