Skip to content

Commit 216db85

Browse files
committed
Auto merge of #4000 - jonhoo:only-incremental-on-nightly, r=alexcrichton
Only pass -Zincremental to nightly rustc. `-Z` can only be used on nightly builds; other builds complain loudly. Since incremental builds only work on nightly anyway, we should silently ignore `CARGO_INCREMENTAL` on anything but nightly. This allows users to always have `CARGO_INCREMENTAL` set without getting unexpected errors on stable/beta builds. Fixes #3835.
2 parents 20a085e + 357bb2d commit 216db85

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)