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

This commit is contained in:
Jonas Platte 2019-12-24 13:29:38 +01:00
parent 86134e7666
commit 2166db8c49
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 8 additions and 3 deletions

View File

@ -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
);
}

View File

@ -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();