Skip to content

Commit a7f3ba9

Browse files
committed
Fix compilation of the doc tests on Windows.
1 parent 7d80510 commit a7f3ba9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

library/std/src/os/fd/owned.rs

+1
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ pub trait AsFd {
205205
/// ```rust,no_run
206206
/// use std::fs::File;
207207
/// # use std::io;
208+
/// # #[cfg(any(unix, target_os = "wasi"))]
208209
/// # use std::os::fd::{AsFd, BorrowedFd};
209210
///
210211
/// let mut f = File::open("foo.txt")?;

library/std/src/os/fd/raw.rs

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub trait AsRawFd {
4242
/// ```no_run
4343
/// use std::fs::File;
4444
/// # use std::io;
45+
/// #[cfg(any(unix, target_os = "wasi"))]
4546
/// use std::os::fd::{AsRawFd, RawFd};
4647
///
4748
/// let mut f = File::open("foo.txt")?;
@@ -80,6 +81,7 @@ pub trait FromRawFd {
8081
/// ```no_run
8182
/// use std::fs::File;
8283
/// # use std::io;
84+
/// #[cfg(any(unix, target_os = "wasi"))]
8385
/// use std::os::fd::{FromRawFd, IntoRawFd, RawFd};
8486
///
8587
/// let f = File::open("foo.txt")?;
@@ -115,6 +117,7 @@ pub trait IntoRawFd {
115117
/// ```no_run
116118
/// use std::fs::File;
117119
/// # use std::io;
120+
/// #[cfg(any(unix, target_os = "wasi"))]
118121
/// use std::os::fd::{IntoRawFd, RawFd};
119122
///
120123
/// let f = File::open("foo.txt")?;

0 commit comments

Comments
 (0)