From 4137b6e8921ad35718a088581822c6d5131681a5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 4 Aug 2023 21:40:37 +1000 Subject: [PATCH] Fix doc compilation Signed-off-by: Jiahao XU --- tokio/src/process/mod.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tokio/src/process/mod.rs b/tokio/src/process/mod.rs index dc7b145a9f4..3672f117afd 100644 --- a/tokio/src/process/mod.rs +++ b/tokio/src/process/mod.rs @@ -1488,8 +1488,9 @@ 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}; + #[cfg(not(docsrs))] macro_rules! impl_traits { ($type:ty) => { impl $type { @@ -1513,6 +1514,30 @@ mod windows { }; } + #[cfg(docsrs)] + macro_rules! impl_traits { + ($type:ty) => { + impl $type { + /// Convert into [`OwnedHandle`]. + pub fn into_owned_handle(self) -> io::Result { + todo!("For doc generation only") + } + } + + impl AsRawHandle for $type { + fn as_raw_handle(&self) -> RawHandle { + todo!("For doc generation only") + } + } + + impl AsHandle for $type { + fn as_handle(&self) -> BorrowedHandle<'_> { + todo!("For doc generation only") + } + } + }; + } + impl_traits!(ChildStdin); impl_traits!(ChildStdout); impl_traits!(ChildStderr);