File tree 2 files changed +16
-1
lines changed
compiler/rustc_session/src
tests/ui/invalid-compile-flags
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -2640,9 +2640,13 @@ pub fn build_session_options(
2640
2640
handler. early_error ( "value for threads must be a positive non-zero integer" ) ;
2641
2641
}
2642
2642
2643
- if unstable_opts. threads > 1 && unstable_opts. fuel . is_some ( ) {
2643
+ let fuel = unstable_opts. fuel . is_some ( ) || unstable_opts. print_fuel . is_some ( ) ;
2644
+ if fuel && unstable_opts. threads > 1 {
2644
2645
handler. early_error ( "optimization fuel is incompatible with multiple threads" ) ;
2645
2646
}
2647
+ if fuel && cg. incremental . is_some ( ) {
2648
+ handler. early_error ( "optimization fuel is incompatible with incremental compilation" ) ;
2649
+ }
2646
2650
2647
2651
let incremental = cg. incremental . as_ref ( ) . map ( PathBuf :: from) ;
2648
2652
Original file line number Diff line number Diff line change
1
+ // revisions: incremental threads
2
+ // dont-check-compiler-stderr
3
+ //
4
+ // [threads] compile-flags: -Zfuel=a=1 -Zthreads=2
5
+ // [threads] error-pattern:optimization fuel is incompatible with multiple threads
6
+ //
7
+ // [incremental] incremental
8
+ // [incremental] compile-flags: -Zprint-fuel=a
9
+ // [incremental] error-pattern:optimization fuel is incompatible with incremental compilation
10
+
11
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments