From 4dda632faf777e415977d28b9697df6cff09b01b Mon Sep 17 00:00:00 2001 From: Without Boats Date: Tue, 24 Mar 2020 00:33:25 +0100 Subject: [PATCH 1/3] IoSlice/IoSliceMut should be Send and Sync --- src/libstd/io/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 83c492fecf974..4323dfff26f62 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -951,6 +951,12 @@ pub trait Read { #[repr(transparent)] pub struct IoSliceMut<'a>(sys::io::IoSliceMut<'a>); +#[stable(feature = "iovec-send-sync", since = "1.44.0")] +unsafe impl<'a> Send for IoSliceMut<'a> { } + +#[stable(feature = "iovec-send-sync", since = "1.44.0")] +unsafe impl<'a> Sync for IoSliceMut<'a> { } + #[stable(feature = "iovec", since = "1.36.0")] impl<'a> fmt::Debug for IoSliceMut<'a> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -1054,6 +1060,12 @@ impl<'a> DerefMut for IoSliceMut<'a> { #[repr(transparent)] pub struct IoSlice<'a>(sys::io::IoSlice<'a>); +#[stable(feature = "iovec-send-sync", since = "1.43.0")] +unsafe impl<'a> Send for IoSlice<'a> { } + +#[stable(feature = "iovec-send-sync", since = "1.43.0")] +unsafe impl<'a> Sync for IoSlice<'a> { } + #[stable(feature = "iovec", since = "1.36.0")] impl<'a> fmt::Debug for IoSlice<'a> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { From 3cc4ef93260adc89eca3799d93757ff1a4c7b43f Mon Sep 17 00:00:00 2001 From: Without Boats Date: Tue, 24 Mar 2020 00:34:48 +0100 Subject: [PATCH 2/3] correct rustc version --- src/libstd/io/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 4323dfff26f62..1022123347ee5 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1060,10 +1060,10 @@ impl<'a> DerefMut for IoSliceMut<'a> { #[repr(transparent)] pub struct IoSlice<'a>(sys::io::IoSlice<'a>); -#[stable(feature = "iovec-send-sync", since = "1.43.0")] +#[stable(feature = "iovec-send-sync", since = "1.44.0")] unsafe impl<'a> Send for IoSlice<'a> { } -#[stable(feature = "iovec-send-sync", since = "1.43.0")] +#[stable(feature = "iovec-send-sync", since = "1.44.0")] unsafe impl<'a> Sync for IoSlice<'a> { } #[stable(feature = "iovec", since = "1.36.0")] From 03c64bf532ceec915f74460daf5344bb8ccf23d3 Mon Sep 17 00:00:00 2001 From: Without Boats Date: Tue, 24 Mar 2020 15:39:29 +0100 Subject: [PATCH 3/3] spaces between braces really ruin readability --- src/libstd/io/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 1022123347ee5..88d556229e4cb 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -952,10 +952,10 @@ pub trait Read { pub struct IoSliceMut<'a>(sys::io::IoSliceMut<'a>); #[stable(feature = "iovec-send-sync", since = "1.44.0")] -unsafe impl<'a> Send for IoSliceMut<'a> { } +unsafe impl<'a> Send for IoSliceMut<'a> {} #[stable(feature = "iovec-send-sync", since = "1.44.0")] -unsafe impl<'a> Sync for IoSliceMut<'a> { } +unsafe impl<'a> Sync for IoSliceMut<'a> {} #[stable(feature = "iovec", since = "1.36.0")] impl<'a> fmt::Debug for IoSliceMut<'a> { @@ -1061,10 +1061,10 @@ impl<'a> DerefMut for IoSliceMut<'a> { pub struct IoSlice<'a>(sys::io::IoSlice<'a>); #[stable(feature = "iovec-send-sync", since = "1.44.0")] -unsafe impl<'a> Send for IoSlice<'a> { } +unsafe impl<'a> Send for IoSlice<'a> {} #[stable(feature = "iovec-send-sync", since = "1.44.0")] -unsafe impl<'a> Sync for IoSlice<'a> { } +unsafe impl<'a> Sync for IoSlice<'a> {} #[stable(feature = "iovec", since = "1.36.0")] impl<'a> fmt::Debug for IoSlice<'a> {