@@ -41,11 +41,9 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
41
41
///
42
42
/// ```no_run
43
43
/// #![feature(anonymous_pipe)]
44
- /// # #[cfg(miri)] fn main() {}
45
- /// # #[cfg(not(miri))]
46
- /// # fn main() -> std::io::Result<()> {
47
44
/// use std::process::Command;
48
45
/// use std::io::{pipe, Read, Write};
46
+ ///
49
47
/// let (ping_rx, mut ping_tx) = pipe()?;
50
48
/// let (mut pong_rx, pong_tx) = pipe()?;
51
49
///
@@ -62,8 +60,7 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
62
60
/// assert_eq!(&buf, "hello");
63
61
///
64
62
/// echo_server.wait()?;
65
- /// # Ok(())
66
- /// # }
63
+ /// # Ok::<(), std::io::Error>(())
67
64
/// ```
68
65
/// [changes]: io#platform-specific-behavior
69
66
/// [man page]: https://man7.org/linux/man-pages/man7/pipe.7.html
@@ -90,12 +87,10 @@ impl PipeReader {
90
87
///
91
88
/// ```no_run
92
89
/// #![feature(anonymous_pipe)]
93
- /// # #[cfg(miri)] fn main() {}
94
- /// # #[cfg(not(miri))]
95
- /// # fn main() -> std::io::Result<()> {
96
90
/// use std::fs;
97
91
/// use std::io::{pipe, Write};
98
92
/// use std::process::Command;
93
+ ///
99
94
/// const NUM_SLOT: u8 = 2;
100
95
/// const NUM_PROC: u8 = 5;
101
96
/// const OUTPUT: &str = "work.txt";
@@ -134,8 +129,7 @@ impl PipeReader {
134
129
/// let xs = fs::read_to_string(OUTPUT)?;
135
130
/// fs::remove_file(OUTPUT)?;
136
131
/// assert_eq!(xs, "x".repeat(NUM_PROC.into()));
137
- /// # Ok(())
138
- /// # }
132
+ /// # Ok::<(), std::io::Error>(())
139
133
/// ```
140
134
#[ unstable( feature = "anonymous_pipe" , issue = "127154" ) ]
141
135
pub fn try_clone ( & self ) -> io:: Result < Self > {
@@ -150,11 +144,9 @@ impl PipeWriter {
150
144
///
151
145
/// ```no_run
152
146
/// #![feature(anonymous_pipe)]
153
- /// # #[cfg(miri)] fn main() {}
154
- /// # #[cfg(not(miri))]
155
- /// # fn main() -> std::io::Result<()> {
156
147
/// use std::process::Command;
157
148
/// use std::io::{pipe, Read};
149
+ ///
158
150
/// let (mut reader, writer) = pipe()?;
159
151
///
160
152
/// // Spawn a process that writes to stdout and stderr.
@@ -174,8 +166,7 @@ impl PipeWriter {
174
166
/// assert_eq!(&msg, "foobar");
175
167
///
176
168
/// peer.wait()?;
177
- /// # Ok(())
178
- /// # }
169
+ /// # Ok::<(), std::io::Error>(())
179
170
/// ```
180
171
#[ unstable( feature = "anonymous_pipe" , issue = "127154" ) ]
181
172
pub fn try_clone ( & self ) -> io:: Result < Self > {
0 commit comments