From 62887398cf3d91323d7d8cdfb4a8c40c14d6cad5 Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Thu, 24 Aug 2023 22:40:22 +0300 Subject: [PATCH] don't use `force-unstable-if-unmarked` with `x test` in standard library doctests. Using `force-unstable-if-unmarked makes` bootstrap process ignoring errors, potentially leading to the merging of PRs that do not compile successfully. Signed-off-by: ozkanonur --- src/bootstrap/bin/rustdoc.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs index 4ecb3349816ee..6ad83a5191a7a 100644 --- a/src/bootstrap/bin/rustdoc.rs +++ b/src/bootstrap/bin/rustdoc.rs @@ -52,9 +52,14 @@ fn main() { // Force all crates compiled by this compiler to (a) be unstable and (b) // allow the `rustc_private` feature to link to other unstable crates // also in the sysroot. - if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() { + if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() + // We don't want to enable this flag on std as this makes bootstrap ignoring the doctests + // errors. + && env::var_os("__CARGO_DEFAULT_LIB_METADATA") != Some(OsString::from("devstd")) + { cmd.arg("-Z").arg("force-unstable-if-unmarked"); } + if let Some(linker) = env::var_os("RUSTDOC_LINKER") { let mut arg = OsString::from("-Clinker="); arg.push(&linker);