Skip to content

Commit

Permalink
Rollup merge of rust-lang#69403 - LeSeulArtichaut:copy-ioslice, r=sfa…
Browse files Browse the repository at this point in the history
…ckler

Implement `Copy` for `IoSlice`

Resolves rust-lang#69395

r? @sfackler
  • Loading branch information
Centril authored Mar 12, 2020
2 parents dab9e21 + 79b8ad8 commit 9252153
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ impl<'a> DerefMut for IoSliceMut<'a> {
/// ABI compatible with the `iovec` type on Unix platforms and `WSABUF` on
/// Windows.
#[stable(feature = "iovec", since = "1.36.0")]
#[derive(Copy, Clone)]
#[repr(transparent)]
pub struct IoSlice<'a>(sys::io::IoSlice<'a>);

Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/cloudabi/io.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::mem;

#[derive(Copy, Clone)]
pub struct IoSlice<'a>(&'a [u8]);

impl<'a> IoSlice<'a> {
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/hermit/io.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::mem;

#[derive(Copy, Clone)]
pub struct IoSlice<'a>(&'a [u8]);

impl<'a> IoSlice<'a> {
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/sgx/io.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::mem;

#[derive(Copy, Clone)]
pub struct IoSlice<'a>(&'a [u8]);

impl<'a> IoSlice<'a> {
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/unix/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::slice;

use libc::{c_void, iovec};

#[derive(Copy, Clone)]
#[repr(transparent)]
pub struct IoSlice<'a> {
vec: iovec,
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/vxworks/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::slice;

use libc::{c_void, iovec};

#[derive(Copy, Clone)]
#[repr(transparent)]
pub struct IoSlice<'a> {
vec: iovec,
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/wasi/io.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::marker::PhantomData;
use crate::slice;

#[derive(Copy, Clone)]
#[repr(transparent)]
pub struct IoSlice<'a> {
vec: wasi::Ciovec,
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/wasm/io.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::mem;

#[derive(Copy, Clone)]
pub struct IoSlice<'a>(&'a [u8]);

impl<'a> IoSlice<'a> {
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ pub struct WSADATA {
pub szSystemStatus: [u8; WSASYS_STATUS_LEN + 1],
}

#[derive(Copy, Clone)]
#[repr(C)]
pub struct WSABUF {
pub len: ULONG,
Expand Down
1 change: 1 addition & 0 deletions src/libstd/sys/windows/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::marker::PhantomData;
use crate::slice;
use crate::sys::c;

#[derive(Copy, Clone)]
#[repr(transparent)]
pub struct IoSlice<'a> {
vec: c::WSABUF,
Expand Down

0 comments on commit 9252153

Please sign in to comment.