Skip to content

Commit

Permalink
Fix doc compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Aug 9, 2023
1 parent f35bcd2 commit 4137b6e
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion tokio/src/process/mod.rs
Expand Up @@ -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 {
Expand All @@ -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<OwnedHandle> {
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);
Expand Down

0 comments on commit 4137b6e

Please sign in to comment.