Skip to content

Commit 1a47e41

Browse files
committed
Fuel is incompatible with incremental compilation
1 parent a73d1bf commit 1a47e41

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

compiler/rustc_session/src/config.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2640,9 +2640,13 @@ pub fn build_session_options(
26402640
handler.early_error("value for threads must be a positive non-zero integer");
26412641
}
26422642

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 {
26442645
handler.early_error("optimization fuel is incompatible with multiple threads");
26452646
}
2647+
if fuel && cg.incremental.is_some() {
2648+
handler.early_error("optimization fuel is incompatible with incremental compilation");
2649+
}
26462650

26472651
let incremental = cg.incremental.as_ref().map(PathBuf::from);
26482652

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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() {}

0 commit comments

Comments
 (0)