Skip to content

Commit

Permalink
Fixing imports when building docs with --cfg docsrs on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jofas committed Nov 7, 2024
1 parent 91a54be commit 59477bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tokio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,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;

Expand Down
4 changes: 2 additions & 2 deletions tokio/src/net/windows/named_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit 59477bd

Please sign in to comment.