Skip to content

Commit

Permalink
Fix doc compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Jiahao XU <[email protected]>
  • Loading branch information
NobodyXu committed Aug 5, 2023
1 parent d59bf6f commit ca14846
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion tokio/src/process/mod.rs
Original file line number Diff line number Diff line change
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 ca14846

Please sign in to comment.