@@ -33,11 +33,9 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
3333///
3434/// ```no_run
3535/// #![feature(anonymous_pipe)]
36- /// # #[cfg(miri)] fn main() {}
37- /// # #[cfg(not(miri))]
38- /// # fn main() -> std::io::Result<()> {
3936/// use std::process::Command;
4037/// use std::io::{pipe, Read, Write};
38+ ///
4139/// let (ping_rx, mut ping_tx) = pipe()?;
4240/// let (mut pong_rx, pong_tx) = pipe()?;
4341///
@@ -55,7 +53,6 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
5553///
5654/// echo_server.wait()?;
5755/// # Ok(())
58- /// # }
5956/// ```
6057/// [changes]: io#platform-specific-behavior
6158/// [man page]: https://man7.org/linux/man-pages/man7/pipe.7.html
@@ -82,12 +79,10 @@ impl PipeReader {
8279 ///
8380 /// ```no_run
8481 /// #![feature(anonymous_pipe)]
85- /// # #[cfg(miri)] fn main() {}
86- /// # #[cfg(not(miri))]
87- /// # fn main() -> std::io::Result<()> {
8882 /// use std::fs;
8983 /// use std::io::{pipe, Write};
9084 /// use std::process::Command;
85+ ///
9186 /// const NUM_SLOT: u8 = 2;
9287 /// const NUM_PROC: u8 = 5;
9388 /// const OUTPUT: &str = "work.txt";
@@ -127,7 +122,6 @@ impl PipeReader {
127122 /// fs::remove_file(OUTPUT)?;
128123 /// assert_eq!(xs, "x".repeat(NUM_PROC.into()));
129124 /// # Ok(())
130- /// # }
131125 /// ```
132126 #[ unstable( feature = "anonymous_pipe" , issue = "127154" ) ]
133127 pub fn try_clone ( & self ) -> io:: Result < Self > {
@@ -142,11 +136,9 @@ impl PipeWriter {
142136 ///
143137 /// ```no_run
144138 /// #![feature(anonymous_pipe)]
145- /// # #[cfg(miri)] fn main() {}
146- /// # #[cfg(not(miri))]
147- /// # fn main() -> std::io::Result<()> {
148139 /// use std::process::Command;
149140 /// use std::io::{pipe, Read};
141+ ///
150142 /// let (mut reader, writer) = pipe()?;
151143 ///
152144 /// // Spawn a process that writes to stdout and stderr.
@@ -167,7 +159,6 @@ impl PipeWriter {
167159 ///
168160 /// peer.wait()?;
169161 /// # Ok(())
170- /// # }
171162 /// ```
172163 #[ unstable( feature = "anonymous_pipe" , issue = "127154" ) ]
173164 pub fn try_clone ( & self ) -> io:: Result < Self > {
0 commit comments