Skip to content

Commit 8d4b5ff

Browse files
authored
Rollup merge of #70342 - withoutboats:io-slice-send-sync, r=Mark-Simulacrum
IoSlice/IoSliceMut should be Send and Sync Closes #70308
2 parents b8093ba + 03c64bf commit 8d4b5ff

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libstd/io/mod.rs

+12
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,12 @@ pub trait Read {
951951
#[repr(transparent)]
952952
pub struct IoSliceMut<'a>(sys::io::IoSliceMut<'a>);
953953

954+
#[stable(feature = "iovec-send-sync", since = "1.44.0")]
955+
unsafe impl<'a> Send for IoSliceMut<'a> {}
956+
957+
#[stable(feature = "iovec-send-sync", since = "1.44.0")]
958+
unsafe impl<'a> Sync for IoSliceMut<'a> {}
959+
954960
#[stable(feature = "iovec", since = "1.36.0")]
955961
impl<'a> fmt::Debug for IoSliceMut<'a> {
956962
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -1054,6 +1060,12 @@ impl<'a> DerefMut for IoSliceMut<'a> {
10541060
#[repr(transparent)]
10551061
pub struct IoSlice<'a>(sys::io::IoSlice<'a>);
10561062

1063+
#[stable(feature = "iovec-send-sync", since = "1.44.0")]
1064+
unsafe impl<'a> Send for IoSlice<'a> {}
1065+
1066+
#[stable(feature = "iovec-send-sync", since = "1.44.0")]
1067+
unsafe impl<'a> Sync for IoSlice<'a> {}
1068+
10571069
#[stable(feature = "iovec", since = "1.36.0")]
10581070
impl<'a> fmt::Debug for IoSlice<'a> {
10591071
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)