]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/builder.rs
Rollup merge of #97087 - Nilstrieb:clarify-slice-iteration-order, r=dtolnay
[rust.git] / src / bootstrap / builder.rs
index bc5af79e0c65f304bdcaf2114e5caad8bcf0d002..761bd66b5057bb931ee1b0ac9d131a8da2855cb8 100644 (file)
@@ -534,7 +534,7 @@ macro_rules! describe {
                 native::Lld,
                 native::CrtBeginEnd
             ),
-            Kind::Check => describe!(
+            Kind::Check | Kind::Clippy | Kind::Fix => describe!(
                 check::Std,
                 check::Rustc,
                 check::Rustdoc,
@@ -664,7 +664,7 @@ macro_rules! describe {
             ),
             Kind::Run => describe!(run::ExpandYamlAnchors, run::BuildManifest, run::BumpStage0),
             // These commands either don't use paths, or they're special-cased in Build::build()
-            Kind::Clean | Kind::Clippy | Kind::Fix | Kind::Format | Kind::Setup => vec![],
+            Kind::Clean | Kind::Format | Kind::Setup => vec![],
         }
     }
 
@@ -1154,9 +1154,13 @@ pub fn cargo(
             // backtrace, core_simd, std_float, ...), those dependencies have their own features
             // but cargo isn't involved in the #[path] and so cannot pass the complete list of
             // features, so for that reason we don't enable checking of features for std.
-            if mode != Mode::Std {
-                cargo.arg("-Zcheck-cfg-features");
-            }
+            //
+            // FIXME: Re-enable this after the beta bump as apperently rustc-perf doesn't use the
+            // beta cargo. See https://github.com/rust-lang/rust/pull/96984#issuecomment-1126678773
+            // #[cfg(not(bootstrap))]
+            // if mode != Mode::Std {
+            //     cargo.arg("-Zcheck-cfg-features"); // -Zcheck-cfg=features after bump
+            // }
 
             // Enable cfg checking of well known names/values
             rustflags
@@ -1222,6 +1226,14 @@ pub fn cargo(
         // this), as well as #63012 which is the tracking issue for this
         // feature on the rustc side.
         cargo.arg("-Zbinary-dep-depinfo");
+        match mode {
+            Mode::ToolBootstrap => {
+                // Restrict the allowed features to those passed by rustbuild, so we don't depend on nightly accidentally.
+                // HACK: because anyhow does feature detection in build.rs, we need to allow the backtrace feature too.
+                rustflags.arg("-Zallow-features=binary-dep-depinfo,backtrace");
+            }
+            Mode::Std | Mode::Rustc | Mode::ToolStd | Mode::Codegen | Mode::ToolRustc => {}
+        }
 
         cargo.arg("-j").arg(self.jobs().to_string());
         // Remove make-related flags to ensure Cargo can correctly set things up