@@ -2121,16 +2121,6 @@ fn should_override_cgus_and_disable_thinlto(
2121
2121
( disable_local_thinlto, codegen_units)
2122
2122
}
2123
2123
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
-
2134
2124
fn collect_print_requests (
2135
2125
handler : & EarlyErrorHandler ,
2136
2126
cg : & mut CodegenOptions ,
@@ -2646,7 +2636,17 @@ pub fn build_session_options(
2646
2636
let ( disable_local_thinlto, mut codegen_units) =
2647
2637
should_override_cgus_and_disable_thinlto ( handler, & output_types, matches, cg. codegen_units ) ;
2648
2638
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
+ }
2650
2650
2651
2651
let incremental = cg. incremental . as_ref ( ) . map ( PathBuf :: from) ;
2652
2652
0 commit comments