Skip to content

Commit a73d1bf

Browse files
committed
Inline check_thread_count implementation
1 parent 0e7f91b commit a73d1bf

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

compiler/rustc_session/src/config.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -2121,16 +2121,6 @@ fn should_override_cgus_and_disable_thinlto(
21212121
(disable_local_thinlto, codegen_units)
21222122
}
21232123

2124-
fn check_thread_count(handler: &EarlyErrorHandler, unstable_opts: &UnstableOptions) {
2125-
if unstable_opts.threads == 0 {
2126-
handler.early_error("value for threads must be a positive non-zero integer");
2127-
}
2128-
2129-
if unstable_opts.threads > 1 && unstable_opts.fuel.is_some() {
2130-
handler.early_error("optimization fuel is incompatible with multiple threads");
2131-
}
2132-
}
2133-
21342124
fn collect_print_requests(
21352125
handler: &EarlyErrorHandler,
21362126
cg: &mut CodegenOptions,
@@ -2646,7 +2636,13 @@ pub fn build_session_options(
26462636
let (disable_local_thinlto, mut codegen_units) =
26472637
should_override_cgus_and_disable_thinlto(handler, &output_types, matches, cg.codegen_units);
26482638

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

26512647
let incremental = cg.incremental.as_ref().map(PathBuf::from);
26522648

0 commit comments

Comments
 (0)