about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2020-01-18 18:35:36 +0100
committerKonrad Borowski <konrad@borowski.pw>2020-01-18 18:50:10 +0100
commita70b24018936fe59f0a037adfa13f2255d8aa5d2 (patch)
tree8f5d0fdb31f426167ddf30852d81be478b47477b /src/libcore
parent8c28fe89c7d33953841e8c210e769ba8ce5ceedb (diff)
downloadrust-a70b24018936fe59f0a037adfa13f2255d8aa5d2.tar.gz
rust-a70b24018936fe59f0a037adfa13f2255d8aa5d2.zip
Make iter::Empty<T> implement Send and Sync for any T
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter/sources.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/iter/sources.rs b/src/libcore/iter/sources.rs
index a65d47cc2c1..25dfc573e41 100644
--- a/src/libcore/iter/sources.rs
+++ b/src/libcore/iter/sources.rs
@@ -208,6 +208,11 @@ pub fn repeat_with<A, F: FnMut() -> A>(repeater: F) -> RepeatWith<F> {
 #[stable(feature = "iter_empty", since = "1.2.0")]
 pub struct Empty<T>(marker::PhantomData<T>);
 
+#[stable(feature = "iter_empty_send_sync", since = "1.42.0")]
+unsafe impl<T> Send for Empty<T> {}
+#[stable(feature = "iter_empty_send_sync", since = "1.42.0")]
+unsafe impl<T> Sync for Empty<T> {}
+
 #[stable(feature = "core_impl_debug", since = "1.9.0")]
 impl<T> fmt::Debug for Empty<T> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {