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

Fixes feature flag used in generating the docs in the README #278

Merged
merged 4 commits into from
Oct 7, 2019

Conversation

Michael-J-Ward
Copy link
Contributor

I thought I'd take a stab at fixing at this #82, but I ran into a few errors following the instruction in the README.md

The first error and one that is addressed in this pull request is that the feature flag used to generate the docs is incorrect- it should be docs and not docs.rs

$ cargo doc --features docs.rs --open

error: Package `async-std v0.99.8 (/home/mike/workspace/async-std)` does not have these features: `docs.rs`

Perhaps additionally, it should be --features docs,unstable as it is in .travis.yml . Should I add that to the README? https://github.com/async-rs/async-std/blob/master/.travis.yml#L53

Lastly, I had to use the +nightly flag to get it to the docs and example to run. Should I add this or is it assumed that the user would have this configured somewhere?

Thanks!

@ghost
Copy link

ghost commented Oct 6, 2019

Lastly, I had to use the +nightly flag to get it to the docs and example to run. Should I add this or is it assumed that the user would have this configured somewhere?

I think it would be good to use +nightly in README.md.

Perhaps additionally, it should be --features docs,unstable as it is in .travis.yml . Should I add that to the README? https://github.com/async-rs/async-std/blob/master/.travis.yml#L53

Maybe the other way around instead. :)

We use #[cfg(any(feature = "unstable", feature = "docs"))] in our code, which means --features docs is enough to render all APIs, even unstable ones. So we can safely remove ,unstable from .travis.yml.

Per Stjepan Glavina, this flag is superfluous because #[cfg(any(feature = "unstable", feature = "docs"))]
is used everywhere in the codebase.

Discussion: async-rs#278 (comment)
@Michael-J-Ward
Copy link
Contributor Author

I've added +nightly to the cargo commands in the README and removed the unstable feature flag from travis.yml and github/workflows/ci.yml

It looks like #[cfg(any(feature = "unstable", feature = "docs"))] is used everywhere except for maybe here:

#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[doc(inline)]
pub use async_macros::ready;

I'm not yet familiar enough to know if that should be changed because it looks it might be handled in another way there.

@ghost
Copy link

ghost commented Oct 6, 2019

@Michael-J-Ward That's a good catch! This line:

#[cfg(feature = "unstable")] 

should be replaced with:

#[cfg(any(feature = "unstable", feature = "docs"))]

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Thanks!

@ghost
Copy link

ghost commented Oct 6, 2019

bors r+

@yoshuawuyts
Copy link
Contributor

bors is hanging, merging this manually!

@yoshuawuyts yoshuawuyts merged commit 46ffe6a into async-rs:master Oct 7, 2019
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.

None yet

2 participants