Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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