Skip to content

Commit

Permalink
Auto merge of #4000 - jonhoo:only-incremental-on-nightly, r=alexcrichton
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed May 7, 2017
2 parents 20a085e + 357bb2d commit 216db85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/cargo/ops/cargo_rustc/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
Err(_) => false,
};

// -Z can only be used on nightly builds; other builds complain loudly.
// Since incremental builds only work on nightly anyway, we 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.
let incremental_enabled = incremental_enabled
&& config.rustc()?.verbose_version.contains("nightly");

Ok(Context {
ws: ws,
host: host_layout,
Expand Down

0 comments on commit 216db85

Please sign in to comment.