]> git.lizzy.rs Git - rust.git/commitdiff
Fix compilation of the doc tests on Windows.
authorDan Gohman <dev@sunfishcode.online>
Fri, 2 Sep 2022 22:35:41 +0000 (15:35 -0700)
committerDan Gohman <dev@sunfishcode.online>
Fri, 2 Sep 2022 22:35:41 +0000 (15:35 -0700)
library/std/src/os/fd/owned.rs
library/std/src/os/fd/raw.rs

index 3a1b04a83fa79b2c53a1875b03810a11c3c98863..37250e6a0ae4475d5f6b910540287b14cf945f6a 100644 (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")?;
index 42a9effcf92abcee35e8d6f8914af4ce3085dd94..f92a05066706d276cb98599992d518e37ee4b6a4 100644 (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")?;