chore: mention fix for building docs in contributing guide (#3618)

I ran into this when writing the docs for `Handle::block_on`. Seems to
be caused by a bug in cargo. Until that is fixed I think it makes sense
to mention it in the contributing guide.
This commit is contained in:
David Pedersen 2021-03-16 13:39:28 +01:00 committed by GitHub
parent f107c4f49b
commit cc90a5c679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,17 +124,27 @@ arguments to many common cargo commands. This section lists some commonly needed
commands. commands.
Some commands just need the `--all-features` argument: Some commands just need the `--all-features` argument:
``` ```
cargo build --all-features cargo build --all-features
cargo check --all-features cargo check --all-features
cargo test --all-features cargo test --all-features
``` ```
When building documentation normally, the markers that list the features When building documentation normally, the markers that list the features
required for various parts of Tokio are missing. To build the documentation required for various parts of Tokio are missing. To build the documentation
correctly, use this command: correctly, use this command:
``` ```
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
``` ```
There is currently a [bug in cargo] that means documentation cannot be built
from the root of the workspace. If you `cd` into the `tokio` subdirectory the
command shown above will work.
[bug in cargo]: https://github.com/rust-lang/cargo/issues/9274
The `cargo fmt` command does not work on the Tokio codebase. You can use the The `cargo fmt` command does not work on the Tokio codebase. You can use the
command below instead: command below instead: