about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorWithout Boats <woboats@gmail.com>2020-03-24 00:33:25 +0100
committerWithout Boats <woboats@gmail.com>2020-03-24 00:33:25 +0100
commit4dda632faf777e415977d28b9697df6cff09b01b (patch)
tree59ce69d35ee4adc2f4b3b6cd7bb65dfc8bf21ae2 /src/libstd
parent1edd389cc4c7b5be7a3dd4fe4b986f6017018e54 (diff)
IoSlice/IoSliceMut should be Send and Sync
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/io/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs
index 83c492fecf9..4323dfff26f 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 {