Skip to content

Commit 92aa5f6

Browse files
committed
Disable linux_ext in wasm32 and fortanix rustdoc builds.
The `std::os::unix` module is stubbed out when building docs for these target platforms. The introduction of Linux-specific extension traits caused `std::os::net` to depend on sub-modules of `std::os::unix`, which broke rustdoc for the `wasm32-unknown-unknown` target. Adding an additional `#[cfg]` guard solves that rustdoc failure by not declaring `linux_ext` on targets with a stubbed `std::os::unix`.
1 parent a377893 commit 92aa5f6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

library/std/src/os/net/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
//! OS-specific networking functionality.
22
3+
// See cfg macros in `library/std/src/os/mod.rs` for why these platforms must
4+
// be special-cased during rustdoc generation.
5+
#[cfg(not(all(
6+
doc,
7+
any(
8+
all(target_arch = "wasm32", not(target_os = "wasi")),
9+
all(target_vendor = "fortanix", target_env = "sgx")
10+
)
11+
)))]
312
#[cfg(any(target_os = "linux", target_os = "android", doc))]
413
pub(super) mod linux_ext;

0 commit comments

Comments
 (0)