diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-03-19 15:03:14 +0100 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-19 15:03:14 +0100 | 
| commit | 4abcd4042c34a80872d0e687b9aa325e68b58d08 (patch) | |
| tree | ef56d035215cec61e39ad46f9bf57c886f233532 | |
| parent | eb95acea8aeaeef834214eaffb15d64095fe9271 (diff) | |
| parent | 2cbea9f98e6d93b85d5f603be311313d41b87525 (diff) | |
| download | rust-4abcd4042c34a80872d0e687b9aa325e68b58d08.tar.gz rust-4abcd4042c34a80872d0e687b9aa325e68b58d08.zip | |
Rollup merge of #82500 - CDirkx:hermit-pipe, r=joshtriplett
Reuse `std::sys::unsupported::pipe` on `hermit` Pipes are not supported on `hermit` and `hermit/pipe.rs` is identical to `unsupported/pipe.rs`. This PR reduces duplication between the two by doing the following on `hermit`: ```rust #[path = "../unsupported/pipe.rs"] pub mod pipe; ```
| -rw-r--r-- | library/std/src/sys/hermit/mod.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/hermit/pipe.rs | 38 | 
2 files changed, 1 insertions, 38 deletions
| diff --git a/library/std/src/sys/hermit/mod.rs b/library/std/src/sys/hermit/mod.rs index f185635b7a0..17a51abeb0e 100644 --- a/library/std/src/sys/hermit/mod.rs +++ b/library/std/src/sys/hermit/mod.rs @@ -32,6 +32,7 @@ pub mod mutex; pub mod net; pub mod os; pub mod path; +#[path = "../unsupported/pipe.rs"] pub mod pipe; #[path = "../unsupported/process.rs"] pub mod process; diff --git a/library/std/src/sys/hermit/pipe.rs b/library/std/src/sys/hermit/pipe.rs deleted file mode 100644 index 10d0925823e..00000000000 --- a/library/std/src/sys/hermit/pipe.rs +++ /dev/null @@ -1,38 +0,0 @@ -use crate::io::{self, IoSlice, IoSliceMut}; -use crate::sys::Void; - -pub struct AnonPipe(Void); - -impl AnonPipe { - pub fn read(&self, _buf: &mut [u8]) -> io::Result<usize> { - match self.0 {} - } - - pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> { - match self.0 {} - } - - pub fn is_read_vectored(&self) -> bool { - match self.0 {} - } - - pub fn write(&self, _buf: &[u8]) -> io::Result<usize> { - match self.0 {} - } - - pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> { - match self.0 {} - } - - pub fn is_write_vectored(&self) -> bool { - match self.0 {} - } - - pub fn diverge(&self) -> ! { - match self.0 {} - } -} - -pub fn read2(p1: AnonPipe, _v1: &mut Vec<u8>, _p2: AnonPipe, _v2: &mut Vec<u8>) -> io::Result<()> { - match p1.0 {} -} | 
