Skip to content
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

docs: annotate io mod with doc_cfg #1808

Merged
merged 5 commits into from
Nov 22, 2019
Merged

docs: annotate io mod with doc_cfg #1808

merged 5 commits into from
Nov 22, 2019

Conversation

carllerche
Copy link
Member

Annotates types in tokio::io module with their required feature flag.
This annotation is included in generated documentation.

Notes:

  • The annotation must be on the type or function itself. Annotating just
    the re-export is not sufficient.

  • The annotation must be inside the pin_project! macro or it is
    lost.

Annotates types in `tokio::io` module with their required feature flag.
This annotation is included in generated documentation.

Notes:

* The annotation must be on the type or function itself. Annotating just
  the re-export is not sufficient.

* The annotation must be **inside** the `pin_project!` macro or it is
  lost.
@carllerche
Copy link
Member Author

Once we land on specifics for style, it can be applied to the rest of the crate.

Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 We should prob add docs on how to build the docs with the flags enabled.

tokio/src/macros/cfg.rs Outdated Show resolved Hide resolved
tokio/src/io/util/flush.rs Outdated Show resolved Hide resolved
@taiki-e
Copy link
Member

taiki-e commented Nov 22, 2019

Perhaps we need to update CI config.

cargo doc --all --no-deps --all-features

rust: stable

cfg_io_util! {
#[derive(Debug)]
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct ReadToEnd<'a, R: ?Sized> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As ReadToEnd is used internally even when io-util feature is disabled, it seems to be necessary to use an attribute.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReadToEnd is only *publicly available w/ the feature. I do need to fix it though.

@carllerche carllerche merged commit 9b2aa14 into master Nov 22, 2019
@taiki-e taiki-e deleted the doc-cfg branch November 22, 2019 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants