Skip to content

Commit 6d2240d

Browse files
Fix compilation errors on unsupported targets
Also fix typos Co-authored-by: Jubilee <[email protected]> Signed-off-by: Jiahao XU <[email protected]>
1 parent 4547b30 commit 6d2240d

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

library/std/src/sys/anonymous_pipe/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Module for annoymous pipe
1+
//! Module for anonymous pipe
22
//!
33
//! ```
44
//! #![feature(anonymous_pipe)]
@@ -8,9 +8,9 @@
88
//! # }
99
//! ```
1010
11-
use crate::{io, process::Stdio, sys::pipe::AnonPipe};
11+
use crate::{io, sys::pipe::AnonPipe};
1212

13-
/// Create annoymous pipe that is close-on-exec and blocking.
13+
/// Create anonymous pipe that is close-on-exec and blocking.
1414
#[unstable(feature = "anonymous_pipe", issue = "127154")]
1515
#[inline]
1616
pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
@@ -25,12 +25,12 @@ pub fn pipe() -> io::Result<(PipeReader, PipeWriter)> {
2525
}
2626
}
2727

28-
/// Read end of the annoymous pipe.
28+
/// Read end of the anonymous pipe.
2929
#[unstable(feature = "anonymous_pipe", issue = "127154")]
3030
#[derive(Debug)]
3131
pub struct PipeReader(AnonPipe);
3232

33-
/// Write end of the annoymous pipe.
33+
/// Write end of the anonymous pipe.
3434
#[unstable(feature = "anonymous_pipe", issue = "127154")]
3535
#[derive(Debug)]
3636
pub struct PipeWriter(AnonPipe);
@@ -137,5 +137,5 @@ mod unix;
137137
#[cfg(windows)]
138138
mod windows;
139139

140-
#[cfg(test)]
140+
#[cfg(all(test, not(miri)))]
141141
mod tests;

library/std/src/sys/anonymous_pipe/unix.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use super::*;
22

33
use crate::{
44
os::fd::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd},
5+
process::Stdio,
56
sys::{
67
fd::FileDesc,
78
pipe::{anon_pipe, AnonPipe},

library/std/src/sys/anonymous_pipe/windows.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::{
44
os::windows::io::{
55
AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle, OwnedHandle, RawHandle,
66
},
7+
process::Stdio,
78
sys::{
89
handle::Handle,
910
pipe::{anon_pipe, AnonPipe, Pipes},

library/std/src/sys/pal/unsupported/pipe.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
1+
use crate::{
2+
fmt,
3+
io::{self, BorrowedCursor, IoSlice, IoSliceMut},
4+
};
25

36
pub struct AnonPipe(!);
47

8+
impl fmt::Debug for AnonPipe {
9+
fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
10+
self.0
11+
}
12+
}
13+
514
impl AnonPipe {
615
pub fn try_clone(&self) -> io::Result<Self> {
716
self.0

0 commit comments

Comments
 (0)