Rollup merge of #95900 - o01eg:fix-wasm-doc, r=Mark-Simulacrum

Fix documentation for wasm32-unknown-unknown

Fixes https://github.com/rust-lang/rust/issues/76526#issuecomment-1094208720
This commit is contained in:
fee1-dead 2022-04-12 22:44:44 +10:00 committed by GitHub
commit cdbdf1ef2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ use crate::fmt;
use crate::fs;
use crate::marker::PhantomData;
use crate::mem::forget;
#[cfg(not(any(target_os = "wasi", target_env = "sgx")))]
#[cfg(not(any(target_arch = "wasm32", target_env = "sgx")))]
use crate::sys::cvt;
use crate::sys_common::{AsInner, FromInner, IntoInner};
@ -76,7 +76,7 @@ impl BorrowedFd<'_> {
impl OwnedFd {
/// Creates a new `OwnedFd` instance that shares the same underlying file handle
/// as the existing `OwnedFd` instance.
#[cfg(not(target_os = "wasi"))]
#[cfg(not(target_arch = "wasm32"))]
pub fn try_clone(&self) -> crate::io::Result<Self> {
// We want to atomically duplicate this file descriptor and set the
// CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
@ -95,7 +95,7 @@ impl OwnedFd {
Ok(unsafe { Self::from_raw_fd(fd) })
}
#[cfg(target_os = "wasi")]
#[cfg(target_arch = "wasm32")]
pub fn try_clone(&self) -> crate::io::Result<Self> {
Err(crate::io::const_io_error!(
crate::io::ErrorKind::Unsupported,

View file

@ -5,7 +5,7 @@
use crate::fs;
use crate::io;
use crate::os::raw;
#[cfg(doc)]
#[cfg(all(doc, not(target_arch = "wasm32")))]
use crate::os::unix::io::AsFd;
#[cfg(unix)]
use crate::os::unix::io::OwnedFd;