]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: Fix compiler docs again
authorOliver Middleton <olliemail27@gmail.com>
Mon, 27 Mar 2017 11:55:57 +0000 (12:55 +0100)
committerOliver Middleton <olliemail27@gmail.com>
Mon, 27 Mar 2017 11:55:57 +0000 (12:55 +0100)
The docs need to be built with the rustbuild feature so the correct
stability attributes (rustc_private) get applied.

src/bootstrap/bin/rustdoc.rs

index e9ca430f1582b4723529255bb17cfb7309fc4d36..3a1a9c3e40d66066b708f48e2de876d38d7fa702 100644 (file)
@@ -40,6 +40,14 @@ fn main() {
         .arg(sysroot)
         .env(bootstrap::util::dylib_path_var(),
              env::join_paths(&dylib_path).unwrap());
+
+    // Pass the `rustbuild` feature flag to crates which rustbuild is
+    // building. See the comment in bootstrap/lib.rs where this env var is
+    // set for more details.
+    if env::var_os("RUSTBUILD_UNSTABLE").is_some() {
+        cmd.arg("--cfg").arg("rustbuild");
+    }
+
     std::process::exit(match cmd.status() {
         Ok(s) => s.code().unwrap_or(1),
         Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),