Fix compilation of the doc tests on Windows.

This commit is contained in:
Dan Gohman 2022-09-02 15:35:41 -07:00
parent 7d80510c16
commit a7f3ba9c13
2 changed files with 4 additions and 0 deletions

View file

@ -205,6 +205,7 @@ pub trait AsFd {
/// ```rust,no_run
/// use std::fs::File;
/// # use std::io;
/// # #[cfg(any(unix, target_os = "wasi"))]
/// # use std::os::fd::{AsFd, BorrowedFd};
///
/// let mut f = File::open("foo.txt")?;

View file

@ -42,6 +42,7 @@ pub trait AsRawFd {
/// ```no_run
/// use std::fs::File;
/// # use std::io;
/// #[cfg(any(unix, target_os = "wasi"))]
/// use std::os::fd::{AsRawFd, RawFd};
///
/// let mut f = File::open("foo.txt")?;
@ -80,6 +81,7 @@ pub trait FromRawFd {
/// ```no_run
/// use std::fs::File;
/// # use std::io;
/// #[cfg(any(unix, target_os = "wasi"))]
/// use std::os::fd::{FromRawFd, IntoRawFd, RawFd};
///
/// let f = File::open("foo.txt")?;
@ -115,6 +117,7 @@ pub trait IntoRawFd {
/// ```no_run
/// use std::fs::File;
/// # use std::io;
/// #[cfg(any(unix, target_os = "wasi"))]
/// use std::os::fd::{IntoRawFd, RawFd};
///
/// let f = File::open("foo.txt")?;