Skip to content

Commit 357bb2d

Browse files
committed
Only pass -Zincremental to nightly rustc.
Fixes #3835
1 parent 20a085e commit 357bb2d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cargo/ops/cargo_rustc/context.rs

+8
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,14 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
8383
Err(_) => false,
8484
};
8585

86+
// -Z can only be used on nightly builds; other builds complain loudly.
87+
// Since incremental builds only work on nightly anyway, we silently
88+
// ignore CARGO_INCREMENTAL on anything but nightly. This allows users
89+
// to always have CARGO_INCREMENTAL set without getting unexpected
90+
// errors on stable/beta builds.
91+
let incremental_enabled = incremental_enabled
92+
&& config.rustc()?.verbose_version.contains("nightly");
93+
8694
Ok(Context {
8795
ws: ws,
8896
host: host_layout,

0 commit comments

Comments
 (0)