Skip to content

Commit

Permalink
Implement Copy for IoSlice
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSeulArtichaut committed Feb 23, 2020
1 parent 87b0d83 commit 79b8ad8
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 @@ -1051,6 +1051,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 79b8ad8

Please sign in to comment.