diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index dc7b145a9f4..0a05bb27ed4 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -1488,10 +1488,11 @@ mod sys { #[cfg_attr(docsrs, doc(cfg(windows)))] mod windows { use super::*; - use crate::os::windows::io::{AsHandle, BorrowedHandle, OwnedHandle}; + use crate::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle, OwnedHandle, RawHandle}; macro_rules! impl_traits { ($type:ty) => { + #[cfg(not(docsrs))] impl $type { /// Convert into [`OwnedHandle`]. pub fn into_owned_handle(self) -> io::Result { @@ -1499,12 +1500,28 @@ mod windows { } } + #[cfg(docsrs)] + impl $type { + /// Convert into [`OwnedHandle`]. + pub fn into_owned_handle(self) -> io::Result { + todo!("For doc generation only") + } + } + + #[cfg(not(docsrs))] impl AsRawHandle for $type { fn as_raw_handle(&self) -> RawHandle { self.inner.as_raw_handle() } } + #[cfg(docsrs)] + impl AsRawHandle for $type { + fn as_raw_handle(&self) -> RawHandle { + todo!("For doc generation only") + } + } + impl AsHandle for $type { fn as_handle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }