diff options
| author | Sky <sky@h4x5.dev> | 2022-11-03 18:26:02 -0400 |
|---|---|---|
| committer | Sky <sky@h4x5.dev> | 2022-11-03 18:26:02 -0400 |
| commit | b473bc9d30d460d37906371c513933a0d2cd8d97 (patch) | |
| tree | 766bf13b0a7fdd33d6ee3956d03602478e5573d0 | |
| parent | 160b19429523ea44c4c3b7cad4233b2a35f58b8f (diff) | |
| download | rust-b473bc9d30d460d37906371c513933a0d2cd8d97.tar.gz rust-b473bc9d30d460d37906371c513933a0d2cd8d97.zip | |
Remove `iter::Empty` hack
| -rw-r--r-- | library/core/src/iter/sources/empty.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/library/core/src/iter/sources/empty.rs b/library/core/src/iter/sources/empty.rs index 98734c527f2..617dfd12383 100644 --- a/library/core/src/iter/sources/empty.rs +++ b/library/core/src/iter/sources/empty.rs @@ -22,17 +22,12 @@ pub const fn empty<T>() -> Empty<T> { 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<T>()` above. -struct FnReturning<T>(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<T>(marker::PhantomData<FnReturning<T>>); +pub struct Empty<T>(marker::PhantomData<fn() -> T>); #[stable(feature = "core_impl_debug", since = "1.9.0")] impl<T> fmt::Debug for Empty<T> { |
