mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
Add a note to the error message for using --feature / --no-default-features in a virtual workspace
This commit is contained in:
parent
86134e7666
commit
2166db8c49
@ -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
|
||||
);
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user