Skip to content

Commit 37c7bea

Browse files
committed
pipe: Remove unnecessary miri exclusions from no_run code
1 parent f770f39 commit 37c7bea

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

library/std/src/io/pipe.rs

+6-15
Original file line numberDiff line numberDiff line change
@@ -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
///
@@ -54,8 +52,7 @@ use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner};
5452
/// assert_eq!(&buf, "hello");
5553
///
5654
/// echo_server.wait()?;
57-
/// # Ok(())
58-
/// # }
55+
/// # Ok::<(), std::io::Error>(())
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";
@@ -126,8 +121,7 @@ impl PipeReader {
126121
/// let xs = fs::read_to_string(OUTPUT)?;
127122
/// fs::remove_file(OUTPUT)?;
128123
/// assert_eq!(xs, "x".repeat(NUM_PROC.into()));
129-
/// # Ok(())
130-
/// # }
124+
/// # Ok::<(), std::io::Error>(())
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.
@@ -166,8 +158,7 @@ impl PipeWriter {
166158
/// assert_eq!(&msg, "foobar");
167159
///
168160
/// peer.wait()?;
169-
/// # Ok(())
170-
/// # }
161+
/// # Ok::<(), std::io::Error>(())
171162
/// ```
172163
#[unstable(feature = "anonymous_pipe", issue = "127154")]
173164
pub fn try_clone(&self) -> io::Result<Self> {

0 commit comments

Comments
 (0)