Skip to content

Commit a70b240

Browse files
Make iter::Empty<T> implement Send and Sync for any T
1 parent 8c28fe8 commit a70b240

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/iter/sources.rs

+5
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ pub fn repeat_with<A, F: FnMut() -> A>(repeater: F) -> RepeatWith<F> {
208208
#[stable(feature = "iter_empty", since = "1.2.0")]
209209
pub struct Empty<T>(marker::PhantomData<T>);
210210

211+
#[stable(feature = "iter_empty_send_sync", since = "1.42.0")]
212+
unsafe impl<T> Send for Empty<T> {}
213+
#[stable(feature = "iter_empty_send_sync", since = "1.42.0")]
214+
unsafe impl<T> Sync for Empty<T> {}
215+
211216
#[stable(feature = "core_impl_debug", since = "1.9.0")]
212217
impl<T> fmt::Debug for Empty<T> {
213218
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)