Skip to content

Commit

Permalink
Auto merge of #7742 - jplatte:master, r=ehuss
Browse files Browse the repository at this point in the history
Add a note to the error message for using --feature / --no-default-features in a virtual workspace

fixes #7727
  • Loading branch information
bors committed Dec 28, 2019
2 parents 5336fba + 2166db8 commit feac578
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cargo/util/command_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ pub trait ArgMatchesExt {
for flag in &["features", "no-default-features"] {
if self._is_present(flag) {
bail!(
"--{} is not allowed in the root of a virtual workspace",
"--{} is not allowed in the root of a virtual workspace\n\
note: while this was previously accepted, it didn't actually do anything",
flag
);
}
Expand Down
8 changes: 6 additions & 2 deletions tests/testsuite/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2017,13 +2017,17 @@ fn virtual_ws_flags() {
.build();

p.cargo("build --features=f1")
.with_stderr("[ERROR] --features is not allowed in the root of a virtual workspace")
.with_stderr(
"[ERROR] --features is not allowed in the root of a virtual workspace\n\
note: while this was previously accepted, it didn't actually do anything",
)
.with_status(101)
.run();

p.cargo("build --no-default-features")
.with_stderr(
"[ERROR] --no-default-features is not allowed in the root of a virtual workspace",
"[ERROR] --no-default-features is not allowed in the root of a virtual workspace\n\
note: while this was previously accepted, it didn't actually do anything",
)
.with_status(101)
.run();
Expand Down

0 comments on commit feac578

Please sign in to comment.