mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
fix: emit errors instead of warnings when glob patterns not found
This commit is contained in:
parent
e5007de6e9
commit
e4a1794b41
@ -158,8 +158,7 @@ impl Packages {
|
|||||||
.map(PackageIdSpec::from_package_id);
|
.map(PackageIdSpec::from_package_id);
|
||||||
specs.extend(matched_pkgs);
|
specs.extend(matched_pkgs);
|
||||||
}
|
}
|
||||||
emit_pattern_not_found(ws, patterns, false)
|
emit_pattern_not_found(ws, patterns, false)?;
|
||||||
.or_else(|e| ws.config().shell().warn(e))?;
|
|
||||||
specs
|
specs
|
||||||
}
|
}
|
||||||
Packages::Default => ws
|
Packages::Default => ws
|
||||||
|
@ -3770,13 +3770,8 @@ fn build_virtual_manifest_glob_not_found() {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
p.cargo("build -p bar -p '*z'")
|
p.cargo("build -p bar -p '*z'")
|
||||||
.with_stderr(
|
.with_status(101)
|
||||||
"\
|
.with_stderr("[ERROR] package pattern(s) `*z` not found in workspace [..]")
|
||||||
[WARNING] package pattern(s) `*z` not found in workspace [..]
|
|
||||||
[COMPILING] bar v0.1.0 ([..])
|
|
||||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
|
||||||
",
|
|
||||||
)
|
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3033,9 +3033,8 @@ fn test_virtual_manifest_glob_not_found() {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
p.cargo("test -p bar -p '*z'")
|
p.cargo("test -p bar -p '*z'")
|
||||||
.with_stderr_contains("[WARNING] package pattern(s) `*z` not found in workspace [..]")
|
.with_status(101)
|
||||||
.with_stdout_contains("running 1 test\ntest bar ... ok")
|
.with_stderr("[ERROR] package pattern(s) `*z` not found in workspace [..]")
|
||||||
.with_stdout_does_not_contain("running 1 test\ntest baz ... ok")
|
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user