From a7f3ba9c135fff78728eb7790aae7907a7621922 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 2 Sep 2022 15:35:41 -0700 Subject: [PATCH] Fix compilation of the doc tests on Windows. --- library/std/src/os/fd/owned.rs | 1 + library/std/src/os/fd/raw.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/library/std/src/os/fd/owned.rs b/library/std/src/os/fd/owned.rs index 3a1b04a83fa..37250e6a0ae 100644 --- a/library/std/src/os/fd/owned.rs +++ b/library/std/src/os/fd/owned.rs @@ -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")?; diff --git a/library/std/src/os/fd/raw.rs b/library/std/src/os/fd/raw.rs index 42a9effcf92..f92a0506670 100644 --- a/library/std/src/os/fd/raw.rs +++ b/library/std/src/os/fd/raw.rs @@ -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")?; -- 2.44.0