Skip to content

Commit

Permalink
Auto merge of #5410 - klnusbaum:edition_5406, r=matklad
Browse files Browse the repository at this point in the history
switch to using the --edition flag

Now that we have an `--edition` flag in the rust compiler, let's switch to using it.

fixes #5406
  • Loading branch information
bors committed Apr 27, 2018
2 parents 9092298 + 0b2aaaf commit 9eece36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down

0 comments on commit 9eece36

Please sign in to comment.