From 0b2aaaffe9f2bdfc0bcdb4b77211221d993ed8db Mon Sep 17 00:00:00 2001 From: Kurtis Nusbaum Date: Sun, 22 Apr 2018 12:14:21 -0700 Subject: [PATCH] switch to using the --edition flag --- src/cargo/core/compiler/mod.rs | 2 +- tests/testsuite/package.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cargo/core/compiler/mod.rs b/src/cargo/core/compiler/mod.rs index c414cafd8..6b843fc92 100644 --- a/src/cargo/core/compiler/mod.rs +++ b/src/cargo/core/compiler/mod.rs @@ -911,7 +911,7 @@ fn build_base_args<'a, 'cfg>( let manifest = unit.pkg.manifest(); if manifest.features().is_enabled(Feature::edition()) { - cmd.arg(format!("-Zedition={}", manifest.edition())); + cmd.arg(format!("--edition={}", manifest.edition())); } // Disable LTO for host builds as prefer_dynamic and it are mutually diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 0a9845a20..d862beee9 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -1119,13 +1119,13 @@ fn test_edition() { assert_that( p.cargo("build").arg("-v").masquerade_as_nightly_cargo(), execs() - // -Zedition is still in flux and we're not passing -Zunstable-options + // --edition is still in flux and we're not passing -Zunstable-options // from Cargo so it will probably error. Only partially match the output // until stuff stabilizes .with_stderr_contains(format!("\ [COMPILING] foo v0.0.1 ({url}) [RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \ - --emit=dep-info,link -Zedition=2018 -C debuginfo=2 \ + --emit=dep-info,link --edition=2018 -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ -L dependency={dir}[/]target[/]debug[/]deps` @@ -1153,13 +1153,13 @@ fn test_edition_missing() { assert_that( p.cargo("build").arg("-v").masquerade_as_nightly_cargo(), execs() - // -Zedition is still in flux and we're not passing -Zunstable-options + // --edition is still in flux and we're not passing -Zunstable-options // from Cargo so it will probably error. Only partially match the output // until stuff stabilizes .with_stderr_contains(format!("\ [COMPILING] foo v0.0.1 ({url}) [RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \ - --emit=dep-info,link -Zedition=2015 -C debuginfo=2 \ + --emit=dep-info,link --edition=2015 -C debuginfo=2 \ -C metadata=[..] \ --out-dir [..] \ -L dependency={dir}[/]target[/]debug[/]deps` -- 2.30.2