Skip to content

Commit 42eb368

Browse files
authored
Unrolled build for rust-lang#128303
Rollup merge of rust-lang#128303 - NobodyXu:specialise-for-pipe, r=cuviper Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}` Enable `std::io::copy` specialisation on unix for the newly added anonymous pipe API, tracking issue rust-lang#127154
2 parents a604303 + 649b431 commit 42eb368

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

library/std/src/sys/pal/unix/kernel_copy.rs

+25
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ use crate::net::TcpStream;
6060
use crate::os::unix::fs::FileTypeExt;
6161
use crate::os::unix::io::{AsRawFd, FromRawFd, RawFd};
6262
use crate::os::unix::net::UnixStream;
63+
use crate::pipe::{PipeReader, PipeWriter};
6364
use crate::process::{ChildStderr, ChildStdin, ChildStdout};
6465
use crate::ptr;
6566
use crate::sync::atomic::{AtomicBool, AtomicU8, Ordering};
@@ -405,6 +406,30 @@ impl CopyWrite for &UnixStream {
405406
}
406407
}
407408

409+
impl CopyRead for PipeReader {
410+
fn properties(&self) -> CopyParams {
411+
CopyParams(FdMeta::Pipe, Some(self.as_raw_fd()))
412+
}
413+
}
414+
415+
impl CopyRead for &PipeReader {
416+
fn properties(&self) -> CopyParams {
417+
CopyParams(FdMeta::Pipe, Some(self.as_raw_fd()))
418+
}
419+
}
420+
421+
impl CopyWrite for PipeWriter {
422+
fn properties(&self) -> CopyParams {
423+
CopyParams(FdMeta::Pipe, Some(self.as_raw_fd()))
424+
}
425+
}
426+
427+
impl CopyWrite for &PipeWriter {
428+
fn properties(&self) -> CopyParams {
429+
CopyParams(FdMeta::Pipe, Some(self.as_raw_fd()))
430+
}
431+
}
432+
408433
impl CopyWrite for ChildStdin {
409434
fn properties(&self) -> CopyParams {
410435
CopyParams(FdMeta::Pipe, Some(self.as_raw_fd()))

0 commit comments

Comments
 (0)