@@ -33,11 +33,9 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
33
33
///
34
34
/// ```no_run
35
35
/// #![feature(anonymous_pipe)]
36
- /// # #[cfg(miri)] fn main() {}
37
- /// # #[cfg(not(miri))]
38
- /// # fn main() -> std::io::Result<()> {
39
36
/// use std::process::Command;
40
37
/// use std::io::{pipe, Read, Write};
38
+ ///
41
39
/// let (ping_rx, mut ping_tx) = pipe()?;
42
40
/// let (mut pong_rx, pong_tx) = pipe()?;
43
41
///
@@ -54,8 +52,7 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
54
52
/// assert_eq!(&buf, "hello");
55
53
///
56
54
/// echo_server.wait()?;
57
- /// # Ok(())
58
- /// # }
55
+ /// # Ok::<(), std::io::Error>(())
59
56
/// ```
60
57
/// [changes]: io#platform-specific-behavior
61
58
/// [man page]: https://man7.org/linux/man-pages/man7/pipe.7.html
@@ -82,12 +79,10 @@ impl PipeReader {
82
79
///
83
80
/// ```no_run
84
81
/// #![feature(anonymous_pipe)]
85
- /// # #[cfg(miri)] fn main() {}
86
- /// # #[cfg(not(miri))]
87
- /// # fn main() -> std::io::Result<()> {
88
82
/// use std::fs;
89
83
/// use std::io::{pipe, Write};
90
84
/// use std::process::Command;
85
+ ///
91
86
/// const NUM_SLOT: u8 = 2;
92
87
/// const NUM_PROC: u8 = 5;
93
88
/// const OUTPUT: &str = "work.txt";
@@ -126,8 +121,7 @@ impl PipeReader {
126
121
/// let xs = fs::read_to_string(OUTPUT)?;
127
122
/// fs::remove_file(OUTPUT)?;
128
123
/// assert_eq!(xs, "x".repeat(NUM_PROC.into()));
129
- /// # Ok(())
130
- /// # }
124
+ /// # Ok::<(), std::io::Error>(())
131
125
/// ```
132
126
#[ unstable( feature = "anonymous_pipe" , issue = "127154" ) ]
133
127
pub fn try_clone ( & self ) -> io:: Result < Self > {
@@ -142,11 +136,9 @@ impl PipeWriter {
142
136
///
143
137
/// ```no_run
144
138
/// #![feature(anonymous_pipe)]
145
- /// # #[cfg(miri)] fn main() {}
146
- /// # #[cfg(not(miri))]
147
- /// # fn main() -> std::io::Result<()> {
148
139
/// use std::process::Command;
149
140
/// use std::io::{pipe, Read};
141
+ ///
150
142
/// let (mut reader, writer) = pipe()?;
151
143
///
152
144
/// // Spawn a process that writes to stdout and stderr.
@@ -166,8 +158,7 @@ impl PipeWriter {
166
158
/// assert_eq!(&msg, "foobar");
167
159
///
168
160
/// peer.wait()?;
169
- /// # Ok(())
170
- /// # }
161
+ /// # Ok::<(), std::io::Error>(())
171
162
/// ```
172
163
#[ unstable( feature = "anonymous_pipe" , issue = "127154" ) ]
173
164
pub fn try_clone ( & self ) -> io:: Result < Self > {
0 commit comments