diff options
| author | The 8472 <git@infinite-source.de> | 2022-08-15 16:24:07 +0200 |
|---|---|---|
| committer | The 8472 <git@infinite-source.de> | 2022-08-15 16:24:07 +0200 |
| commit | 84531229bb923cdad698f271bdc1311f67f174e8 (patch) | |
| tree | 2cab28f1b7a68f578c808c70705c5d54c1fa9e46 /compiler/rustc_session/src | |
| parent | 6ce76091c7cef21692a15dce1f0a4c415d245be4 (diff) | |
| download | rust-84531229bb923cdad698f271bdc1311f67f174e8.tar.gz rust-84531229bb923cdad698f271bdc1311f67f174e8.zip | |
Revert "Revert "Remove num_cpus dependency from bootstrap, build-manifest and rustc_session""
This reverts commit 1ae4b258267462da0b1aae1badcf83578153c799.
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/options.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 63ae91f8e6c..46bba02537d 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -582,7 +582,7 @@ mod parse { pub(crate) fn parse_threads(slot: &mut usize, v: Option<&str>) -> bool { match v.and_then(|s| s.parse().ok()) { Some(0) => { - *slot = ::num_cpus::get(); + *slot = std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get); true } Some(i) => { |
