]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/flags.rs
Rollup merge of #101057 - cjgillot:one-fn-sig, r=compiler-errors
[rust.git] / src / bootstrap / flags.rs
index 39d9ce1621ba2a751ae1007632f75a0d0012fa4b..789da74810035fee1ba918183bab31b61ff2348c 100644 (file)
@@ -80,6 +80,7 @@ pub struct Flags {
     pub llvm_profile_generate: bool,
 }
 
+#[derive(Debug)]
 #[cfg_attr(test, derive(Clone))]
 pub enum Subcommand {
     Build {
@@ -219,7 +220,7 @@ pub fn parse(args: &[String]) -> Flags {
         let j_msg = format!(
             "number of jobs to run in parallel; \
              defaults to {} (this host's logical CPU count)",
-            num_cpus::get()
+            std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
         );
         opts.optopt("j", "jobs", &j_msg, "JOBS");
         opts.optflag("h", "help", "print this help message");