diff options
| author | Oliver Middleton <olliemail27@gmail.com> | 2017-03-12 02:45:20 +0000 |
|---|---|---|
| committer | Oliver Middleton <olliemail27@gmail.com> | 2017-03-12 02:45:20 +0000 |
| commit | 7b04f7fa637ece96da6da7f5a96ded9598b2bf36 (patch) | |
| tree | f97934606a4d5bb68dc8e72ed249b75c682f3365 /src/bootstrap/doc.rs | |
| parent | 5d0be0d72a8fe87c1a038f014beb7f64ba249b29 (diff) | |
rustbuild: Fix compiler docs
* Make sure std docs are generated before compiler docs so rustdoc uses relative links. * Don't document the rustc and rustdoc binary crates as they overwrite the real rustc and rustdoc crates.
Diffstat (limited to 'src/bootstrap/doc.rs')
| -rw-r--r-- | src/bootstrap/doc.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 5a5cfe0c682..db8ed579cec 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -168,9 +168,7 @@ pub fn std(build: &Build, stage: u32, target: &str) { // We don't want to build docs for internal std dependencies unless // in compiler-docs mode. When not in that mode, we whitelist the crates // for which docs must be built. - if build.config.compiler_docs { - cargo.arg("-p").arg("std"); - } else { + if !build.config.compiler_docs { cargo.arg("--no-deps"); for krate in &["alloc", "collections", "core", "std", "std_unicode"] { cargo.arg("-p").arg(krate); @@ -244,9 +242,15 @@ pub fn rustc(build: &Build, stage: u32, target: &str) { .arg(build.src.join("src/rustc/Cargo.toml")) .arg("--features").arg(build.rustc_features()); - // Like with libstd above if compiler docs aren't enabled then we're not - // documenting internal dependencies, so we have a whitelist. - if !build.config.compiler_docs { + if build.config.compiler_docs { + // src/rustc/Cargo.toml contains bin crates called rustc and rustdoc + // which would otherwise overwrite the docs for the real rustc and + // rustdoc lib crates. + cargo.arg("-p").arg("rustc_driver") + .arg("-p").arg("rustdoc"); + } else { + // Like with libstd above if compiler docs aren't enabled then we're not + // documenting internal dependencies, so we have a whitelist. cargo.arg("--no-deps"); for krate in &["proc_macro"] { cargo.arg("-p").arg(krate); |
