Skip to content

Commit 09a6319

Browse files
committed
Inline check_thread_count implementation
1 parent e9b7bf0 commit 09a6319

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,16 +2123,6 @@ fn should_override_cgus_and_disable_thinlto(
21232123
(disable_local_thinlto, codegen_units)
21242124
}
21252125

2126-
fn check_thread_count(handler: &EarlyErrorHandler, unstable_opts: &UnstableOptions) {
2127-
if unstable_opts.threads == 0 {
2128-
handler.early_error("value for threads must be a positive non-zero integer");
2129-
}
2130-
2131-
if unstable_opts.threads > 1 && unstable_opts.fuel.is_some() {
2132-
handler.early_error("optimization fuel is incompatible with multiple threads");
2133-
}
2134-
}
2135-
21362126
fn collect_print_requests(
21372127
handler: &EarlyErrorHandler,
21382128
cg: &mut CodegenOptions,
@@ -2642,7 +2632,13 @@ pub fn build_session_options(
26422632
let (disable_local_thinlto, mut codegen_units) =
26432633
should_override_cgus_and_disable_thinlto(handler, &output_types, matches, cg.codegen_units);
26442634

2645-
check_thread_count(handler, &unstable_opts);
2635+
if unstable_opts.threads == 0 {
2636+
handler.early_error("value for threads must be a positive non-zero integer");
2637+
}
2638+
2639+
if unstable_opts.threads > 1 && unstable_opts.fuel.is_some() {
2640+
handler.early_error("optimization fuel is incompatible with multiple threads");
2641+
}
26462642

26472643
let incremental = cg.incremental.as_ref().map(PathBuf::from);
26482644

0 commit comments

Comments
 (0)