Skip to content

Commit 9eece36

Browse files
committed
Auto merge of #5410 - klnusbaum:edition_5406, r=matklad
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
2 parents 9092298 + 0b2aaaf commit 9eece36

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/cargo/core/compiler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ fn build_base_args<'a, 'cfg>(
911911
let manifest = unit.pkg.manifest();
912912

913913
if manifest.features().is_enabled(Feature::edition()) {
914-
cmd.arg(format!("-Zedition={}", manifest.edition()));
914+
cmd.arg(format!("--edition={}", manifest.edition()));
915915
}
916916

917917
// Disable LTO for host builds as prefer_dynamic and it are mutually

tests/testsuite/package.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,13 +1119,13 @@ fn test_edition() {
11191119
assert_that(
11201120
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
11211121
execs()
1122-
// -Zedition is still in flux and we're not passing -Zunstable-options
1122+
// --edition is still in flux and we're not passing -Zunstable-options
11231123
// from Cargo so it will probably error. Only partially match the output
11241124
// until stuff stabilizes
11251125
.with_stderr_contains(format!("\
11261126
[COMPILING] foo v0.0.1 ({url})
11271127
[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \
1128-
--emit=dep-info,link -Zedition=2018 -C debuginfo=2 \
1128+
--emit=dep-info,link --edition=2018 -C debuginfo=2 \
11291129
-C metadata=[..] \
11301130
--out-dir [..] \
11311131
-L dependency={dir}[/]target[/]debug[/]deps`
@@ -1153,13 +1153,13 @@ fn test_edition_missing() {
11531153
assert_that(
11541154
p.cargo("build").arg("-v").masquerade_as_nightly_cargo(),
11551155
execs()
1156-
// -Zedition is still in flux and we're not passing -Zunstable-options
1156+
// --edition is still in flux and we're not passing -Zunstable-options
11571157
// from Cargo so it will probably error. Only partially match the output
11581158
// until stuff stabilizes
11591159
.with_stderr_contains(format!("\
11601160
[COMPILING] foo v0.0.1 ({url})
11611161
[RUNNING] `rustc --crate-name foo src[/]lib.rs --crate-type lib \
1162-
--emit=dep-info,link -Zedition=2015 -C debuginfo=2 \
1162+
--emit=dep-info,link --edition=2015 -C debuginfo=2 \
11631163
-C metadata=[..] \
11641164
--out-dir [..] \
11651165
-L dependency={dir}[/]target[/]debug[/]deps`

0 commit comments

Comments
 (0)