Skip to content

Commit bf312ce

Browse files
committed
doc: correct cargo doc command in contrib guide
The command to build the documentation locally provided in the Contribution Guide did not work for all crates in the project workspace. Specifically, to build the docs for `tokio-stream` the flag `--cfg docsrs` needs to be in the environment variable `RUSTFLAGS` in addition to being in `RUSTDOCFLAGS`. Additionally, there was text describing that the docs cannot be built from the root of the workspace with a link to rust-lang/cargo#9274. That issue has since been closed as complete and the listed commands do now work from the root of the workspace. As such, that text has been removed.
1 parent e005b6c commit bf312ce

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,17 @@ required for various parts of Tokio are missing. To build the documentation
154154
correctly, use this command:
155155

156156
```
157-
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
157+
RUSTDOCFLAGS="--cfg docsrs" RUSTFLAGS="--cfg docsrs" cargo +nightly doc --all-features
158158
```
159159

160160
To build documentation including Tokio's unstable features, it is necessary to
161161
pass `--cfg tokio_unstable` to both RustDoc *and* rustc. To build the
162162
documentation for unstable features, use this command:
163163

164164
```
165-
RUSTDOCFLAGS="--cfg docsrs --cfg tokio_unstable" RUSTFLAGS="--cfg tokio_unstable" cargo +nightly doc --all-features
165+
RUSTDOCFLAGS="--cfg docsrs --cfg tokio_unstable" RUSTFLAGS="--cfg docsrs --cfg tokio_unstable" cargo +nightly doc --all-features
166166
```
167167

168-
There is currently a [bug in cargo] that means documentation cannot be built
169-
from the root of the workspace. If you `cd` into the `tokio` subdirectory the
170-
command shown above will work.
171-
172-
[bug in cargo]: https://github.com/rust-lang/cargo/issues/9274
173-
174168
The `cargo fmt` command does not work on the Tokio codebase. You can use the
175169
command below instead:
176170

0 commit comments

Comments
 (0)