diff --git a/src/libcore/iter/sources.rs b/src/libcore/iter/sources.rs index 2590fa6023a53..f6a3bdea40cab 100644 --- a/src/libcore/iter/sources.rs +++ b/src/libcore/iter/sources.rs @@ -198,7 +198,10 @@ pub fn repeat_with A>(repeater: F) -> RepeatWith { /// /// [`empty`]: fn.empty.html #[stable(feature = "iter_empty", since = "1.2.0")] -pub struct Empty(marker::PhantomData); +pub struct Empty(marker::PhantomData>); + +// Workaround for PhantomData T> not being allowed in const fn. +struct PhantomFnWorkaround(fn() -> T); #[stable(feature = "core_impl_debug", since = "1.9.0")] impl fmt::Debug for Empty { diff --git a/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs b/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs index 903bbf5163443..3e9d1a8f702d8 100644 --- a/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs +++ b/src/test/run-pass/threads-sendsync/sync-send-iterators-in-libcore.rs @@ -91,6 +91,7 @@ fn main() { is_sync_send!((1..)); is_sync_send!(repeat(1)); is_sync_send!(empty::()); + is_sync_send!(empty::<*mut i32>()); is_sync_send!(once(1)); // for option.rs