-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bus::get_pollfd generate doc for both unix & windows #95
Conversation
Please note the comment from commit 5fe5318: Inclusion of this commit is debatable because the "other" platform's doc Note that this behaviour is also present when searching for traits. So, |
Sounds like all options are bad :) I'll think about it a bit, thanks! |
There might be yet another way, defining an OS independent alias for Too bad the message "This is supported on Windows/Unix only" is removed when generating doc with gir, otherwise I believe the resulting documentation for |
Maybe we can always call the traits Otherwise this looks like a good solution. I don't think we can get |
FWIW, I merged the futures commit into master and 1.14 independent of these changes here |
When feature `dox` is selected but not `futures`, the `futures` crate is not available as a dependency leading to a "can't find crate for `futures`" error.
There are different implementations and signatures for `get_pollfd` depending on whether the target platform is unix or windows. When generating the doc, we need both implementations to appear regardless of the target platform. This commit is inspired by the way Rust `std` library deals with `process::Command` OS dependent variants (https://doc.rust-lang.org/std/process/struct.Command.html#impl-CommandExt). Documentation can't be accurate though as we can't use the`std::os::windows` on `unix` and vice versa. As a workaround a fake fd class matching the other platform is declared. This could be further enhanced once `#[doc(cfg(...))]` is stabilized (rust-lang/rust#43781) by declaring `#[doc(cfg(unix))]` or `#[doc(cfg(windows))]` instead of the hard coded comments `This is supported on **Windows/Unix** only`. Unfortunately, these comments disappear when generating will `--all-features` because they are not part of the documentation in the gir file.
Yes, of course that's the best compromise. Just updated the commit stack with this approach. Sorry, I wasn't clear about the handles navigation. I meant navigating in the doc as being able to access documentation of the actual handle in the |
Thanks, I think this solution is good for now :) I'm planning to release some time later today with the 1.14 branch btw, or tomorrow. In case you have something else that should be merged before that. |
Great! I don't have plans for more commits right now. |
Ok :) Thanks for all your work! |
My pleasure! |
There are different implementations and signatures for
get_pollfd
dependingon whether the target platform is unix or windows. When generating the doc,
we need both implementations to appear regardless of the target platform. This
commit is inspired by the way Rust
std
library deals withprocess::Command
OS dependent variants.
Documentation can't be accurate though as we can't use the
std::os::windows
on
unix
and vice versa. As a workaround a fake fd class matching the otherplatform is declared.
This could be further enhanced once
#[doc(cfg(...))]
is stabilizedby declaring
#[doc(cfg(unix))]
or#[doc(cfg(windows))]
instead of the hard codedcomments
This is supported on **Windows/Unix** only
. Unfortunately, thesecomments disappear when generating with
--all-features
because they are not partof the documentation in the gir file. Is there a way to prevent them from being removed?