summaryrefslogtreecommitdiffstats
path: root/src/bootstrap/bin/rustdoc.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:03:36 +0000
commit17d40c6057c88f4c432b0d7bac88e1b84cb7e67f (patch)
tree3f66c4a5918660bb8a758ab6cda5ff8ee4f6cdcd /src/bootstrap/bin/rustdoc.rs
parentAdding upstream version 1.64.0+dfsg1. (diff)
downloadrustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.tar.xz
rustc-17d40c6057c88f4c432b0d7bac88e1b84cb7e67f.zip
Adding upstream version 1.65.0+dfsg1.upstream/1.65.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bootstrap/bin/rustdoc.rs')
-rw-r--r--src/bootstrap/bin/rustdoc.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
index 87c1d22e7..e69cab956 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -11,6 +11,7 @@ include!("../dylib_util.rs");
fn main() {
let args = env::args_os().skip(1).collect::<Vec<_>>();
+ let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
let rustdoc = env::var_os("RUSTDOC_REAL").expect("RUSTDOC_REAL was not set");
let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set");
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
@@ -62,6 +63,16 @@ fn main() {
cmd.arg("-Clink-arg=-Wl,--threads=1");
}
}
+ // Cargo doesn't pass RUSTDOCFLAGS to proc_macros:
+ // https://github.com/rust-lang/cargo/issues/4423
+ // Thus, if we are on stage 0, we explicitly set `--cfg=bootstrap`.
+ // We also declare that the flag is expected, which we need to do to not
+ // get warnings about it being unexpected.
+ if stage == "0" {
+ cmd.arg("--cfg=bootstrap");
+ }
+ cmd.arg("-Zunstable-options");
+ cmd.arg("--check-cfg=values(bootstrap)");
if verbose > 1 {
eprintln!(