@@ -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-
21342124fn collect_print_requests (
21352125 handler : & EarlyErrorHandler ,
21362126 cg : & mut CodegenOptions ,
@@ -2646,7 +2636,17 @@ 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+ let fuel = unstable_opts. fuel . is_some ( ) || unstable_opts. print_fuel . is_some ( ) ;
2644+ if fuel && unstable_opts. threads > 1 {
2645+ handler. early_error ( "optimization fuel is incompatible with multiple threads" ) ;
2646+ }
2647+ if fuel && cg. incremental . is_some ( ) {
2648+ handler. early_error ( "optimization fuel is incompatible with incremental compilation" ) ;
2649+ }
26502650
26512651 let incremental = cg. incremental . as_ref ( ) . map ( PathBuf :: from) ;
26522652
0 commit comments