docs: fix documentation build on Windows (#6945)

This commit is contained in:
Jonas Fassbender
2024-11-14 01:28:55 +09:00
committed by GitHub
parent 3b677d1fde
commit 772e0ca8a6
6 changed files with 32 additions and 15 deletions
+3
View File
@@ -231,6 +231,9 @@ cfg_io_driver_impl! {
pub(crate) use poll_evented::PollEvented;
}
// The bsd module can't be build on Windows, so we completely ignore it, even
// when building documentation.
#[cfg(unix)]
cfg_aio! {
/// BSD-specific I/O types.
pub mod bsd {
+4 -3
View File
@@ -19,6 +19,7 @@
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]
#![cfg_attr(loom, allow(dead_code, unreachable_pub))]
#![cfg_attr(windows, allow(rustdoc::broken_intra_doc_links))]
//! A runtime for writing reliable network applications without compromising speed.
//!
@@ -633,15 +634,15 @@ pub mod stream {}
// local re-exports of platform specific things, allowing for decent
// documentation to be shimmed in on docs.rs
#[cfg(docsrs)]
#[cfg(all(docsrs, unix))]
pub mod doc;
#[cfg(any(feature = "net", feature = "fs"))]
#[cfg(docsrs)]
#[cfg(all(docsrs, unix))]
#[allow(unused)]
pub(crate) use self::doc::os;
#[cfg(not(docsrs))]
#[cfg(not(all(docsrs, unix)))]
#[allow(unused)]
pub(crate) use std::os;
+3
View File
@@ -787,6 +787,9 @@ impl fmt::Debug for TcpSocket {
}
}
// These trait implementations can't be build on Windows, so we completely
// ignore them, even when building documentation.
#[cfg(unix)]
cfg_unix! {
impl AsRawFd for TcpSocket {
fn as_raw_fd(&self) -> RawFd {
+2 -2
View File
@@ -17,7 +17,7 @@ cfg_io_util! {
}
// Hide imports which are not used when generating documentation.
#[cfg(not(docsrs))]
#[cfg(windows)]
mod doc {
pub(super) use crate::os::windows::ffi::OsStrExt;
pub(super) mod windows_sys {
@@ -30,7 +30,7 @@ mod doc {
}
// NB: none of these shows up in public API, so don't document them.
#[cfg(docsrs)]
#[cfg(not(windows))]
mod doc {
pub(super) mod mio_windows {
pub type NamedPipe = crate::doc::NotDefinedHere;
+5 -3
View File
@@ -12,13 +12,15 @@ use crate::signal::RxFuture;
use std::io;
use std::task::{Context, Poll};
#[cfg(not(docsrs))]
#[cfg(windows)]
#[path = "windows/sys.rs"]
mod imp;
#[cfg(not(docsrs))]
#[cfg(windows)]
pub(crate) use self::imp::{OsExtraData, OsStorage};
#[cfg(docsrs)]
// For building documentation on Unix machines when the `docsrs` flag is set.
#[cfg(not(windows))]
#[path = "windows/stub.rs"]
mod imp;