diff options
| author | bors <bors@rust-lang.org> | 2019-02-24 06:59:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-02-24 06:59:13 +0000 |
| commit | e17c48e2f21eefd59748e364234efc7037a3ec96 (patch) | |
| tree | a989c587e29193df64c07d603037060b3dcefc6b /src/libstd/sys/cloudabi | |
| parent | 7cb3ee453b829a513749eb49e6cbe7fe4da527b1 (diff) | |
| parent | f01ebc56dc9000f0f6507121e6702f83c2b8d2e2 (diff) | |
| download | rust-e17c48e2f21eefd59748e364234efc7037a3ec96.tar.gz rust-e17c48e2f21eefd59748e364234efc7037a3ec96.zip | |
Auto merge of #58691 - Centril:rollup, r=Centril
Rollup of 6 pull requests Successful merges: - #57364 (Improve parsing diagnostic for negative supertrait bounds) - #58183 (Clarify guarantees for `Box` allocation) - #58442 (Simplify the unix `Weak` functionality) - #58454 (Refactor Windows stdio and remove stdin double buffering ) - #58511 (Const to op simplification) - #58642 (rustdoc: support methods on primitives in intra-doc links) Failed merges: r? @ghost
Diffstat (limited to 'src/libstd/sys/cloudabi')
| -rw-r--r-- | src/libstd/sys/cloudabi/stdio.rs | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/libstd/sys/cloudabi/stdio.rs b/src/libstd/sys/cloudabi/stdio.rs index 2cd3477cd51..81d79213f61 100644 --- a/src/libstd/sys/cloudabi/stdio.rs +++ b/src/libstd/sys/cloudabi/stdio.rs @@ -9,8 +9,10 @@ impl Stdin { pub fn new() -> io::Result<Stdin> { Ok(Stdin(())) } +} - pub fn read(&self, _: &mut [u8]) -> io::Result<usize> { +impl io::Read for Stdin { + fn read(&mut self, _buf: &mut [u8]) -> io::Result<usize> { Ok(0) } } @@ -19,15 +21,17 @@ impl Stdout { pub fn new() -> io::Result<Stdout> { Ok(Stdout(())) } +} - pub fn write(&self, _: &[u8]) -> io::Result<usize> { +impl io::Write for Stdout { + fn write(&mut self, _buf: &[u8]) -> io::Result<usize> { Err(io::Error::new( io::ErrorKind::BrokenPipe, "Stdout is not connected to any output in this environment", )) } - pub fn flush(&self) -> io::Result<()> { + fn flush(&mut self) -> io::Result<()> { Ok(()) } } @@ -36,29 +40,18 @@ impl Stderr { pub fn new() -> io::Result<Stderr> { Ok(Stderr(())) } +} - pub fn write(&self, _: &[u8]) -> io::Result<usize> { +impl io::Write for Stderr { + fn write(&mut self, _buf: &[u8]) -> io::Result<usize> { Err(io::Error::new( io::ErrorKind::BrokenPipe, "Stderr is not connected to any output in this environment", )) } - pub fn flush(&self) -> io::Result<()> { - Ok(()) - } -} - -// FIXME: right now this raw stderr handle is used in a few places because -// std::io::stderr_raw isn't exposed, but once that's exposed this impl -// should go away -impl io::Write for Stderr { - fn write(&mut self, data: &[u8]) -> io::Result<usize> { - Stderr::write(self, data) - } - fn flush(&mut self) -> io::Result<()> { - Stderr::flush(self) + Ok(()) } } |
