about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2023-11-29 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2023-12-07 23:28:44 +0100
commita73d1bf6313e4126bedf8fa3ed14ffbea94d8513 (patch)
treecc96cac936d281db65347576d0aca2c6e240062c
parent0e7f91b75e7484a713e2f644212cfc1aa7478a28 (diff)
downloadrust-a73d1bf6313e4126bedf8fa3ed14ffbea94d8513.tar.gz
rust-a73d1bf6313e4126bedf8fa3ed14ffbea94d8513.zip
Inline check_thread_count implementation
-rw-r--r--compiler/rustc_session/src/config.rs18
1 files changed, 7 insertions, 11 deletions
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index e694e150b31..b431c6b9213 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -2121,16 +2121,6 @@ fn should_override_cgus_and_disable_thinlto(
     (disable_local_thinlto, codegen_units)
 }
 
-fn check_thread_count(handler: &EarlyErrorHandler, unstable_opts: &UnstableOptions) {
-    if unstable_opts.threads == 0 {
-        handler.early_error("value for threads must be a positive non-zero integer");
-    }
-
-    if unstable_opts.threads > 1 && unstable_opts.fuel.is_some() {
-        handler.early_error("optimization fuel is incompatible with multiple threads");
-    }
-}
-
 fn collect_print_requests(
     handler: &EarlyErrorHandler,
     cg: &mut CodegenOptions,
@@ -2646,7 +2636,13 @@ pub fn build_session_options(
     let (disable_local_thinlto, mut codegen_units) =
         should_override_cgus_and_disable_thinlto(handler, &output_types, matches, cg.codegen_units);
 
-    check_thread_count(handler, &unstable_opts);
+    if unstable_opts.threads == 0 {
+        handler.early_error("value for threads must be a positive non-zero integer");
+    }
+
+    if unstable_opts.threads > 1 && unstable_opts.fuel.is_some() {
+        handler.early_error("optimization fuel is incompatible with multiple threads");
+    }
 
     let incremental = cg.incremental.as_ref().map(PathBuf::from);