Skip to content

Commit e537f32

Browse files
authored
Rollup merge of rust-lang#95900 - o01eg:fix-wasm-doc, r=Mark-Simulacrum
Fix documentation for wasm32-unknown-unknown Fixes rust-lang#76526 (comment)
2 parents 12a48a8 + 3f4bbd5 commit e537f32

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::fmt;
88
use crate::fs;
99
use crate::marker::PhantomData;
1010
use crate::mem::forget;
11-
#[cfg(not(any(target_os = "wasi", target_env = "sgx")))]
11+
#[cfg(not(any(target_arch = "wasm32", target_env = "sgx")))]
1212
use crate::sys::cvt;
1313
use crate::sys_common::{AsInner, FromInner, IntoInner};
1414

@@ -76,7 +76,7 @@ impl BorrowedFd<'_> {
7676
impl OwnedFd {
7777
/// Creates a new `OwnedFd` instance that shares the same underlying file handle
7878
/// as the existing `OwnedFd` instance.
79-
#[cfg(not(target_os = "wasi"))]
79+
#[cfg(not(target_arch = "wasm32"))]
8080
pub fn try_clone(&self) -> crate::io::Result<Self> {
8181
// We want to atomically duplicate this file descriptor and set the
8282
// CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
@@ -95,7 +95,7 @@ impl OwnedFd {
9595
Ok(unsafe { Self::from_raw_fd(fd) })
9696
}
9797

98-
#[cfg(target_os = "wasi")]
98+
#[cfg(target_arch = "wasm32")]
9999
pub fn try_clone(&self) -> crate::io::Result<Self> {
100100
Err(crate::io::const_io_error!(
101101
crate::io::ErrorKind::Unsupported,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use crate::fs;
66
use crate::io;
77
use crate::os::raw;
8-
#[cfg(doc)]
8+
#[cfg(all(doc, not(target_arch = "wasm32")))]
99
use crate::os::unix::io::AsFd;
1010
#[cfg(unix)]
1111
use crate::os::unix::io::OwnedFd;

0 commit comments

Comments
 (0)