Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note to the error message for using --feature / --no-default-features in a virtual workspace #7742

Merged
merged 1 commit into from
Dec 28, 2019
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
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