diff --git a/src/cargo/ops/cargo_compile.rs b/src/cargo/ops/cargo_compile.rs index 7470caaf3..bc684e051 100644 --- a/src/cargo/ops/cargo_compile.rs +++ b/src/cargo/ops/cargo_compile.rs @@ -158,8 +158,7 @@ impl Packages { .map(PackageIdSpec::from_package_id); specs.extend(matched_pkgs); } - emit_pattern_not_found(ws, patterns, false) - .or_else(|e| ws.config().shell().warn(e))?; + emit_pattern_not_found(ws, patterns, false)?; specs } Packages::Default => ws diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index 9958f1f83..ba9a89004 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -3770,13 +3770,8 @@ fn build_virtual_manifest_glob_not_found() { .build(); p.cargo("build -p bar -p '*z'") - .with_stderr( - "\ -[WARNING] package pattern(s) `*z` not found in workspace [..] -[COMPILING] bar v0.1.0 ([..]) -[FINISHED] dev [unoptimized + debuginfo] target(s) in [..] -", - ) + .with_status(101) + .with_stderr("[ERROR] package pattern(s) `*z` not found in workspace [..]") .run(); } diff --git a/tests/testsuite/test.rs b/tests/testsuite/test.rs index 9bc3b3062..4ba9a4db8 100644 --- a/tests/testsuite/test.rs +++ b/tests/testsuite/test.rs @@ -3033,9 +3033,8 @@ fn test_virtual_manifest_glob_not_found() { .build(); p.cargo("test -p bar -p '*z'") - .with_stderr_contains("[WARNING] package pattern(s) `*z` not found in workspace [..]") - .with_stdout_contains("running 1 test\ntest bar ... ok") - .with_stdout_does_not_contain("running 1 test\ntest baz ... ok") + .with_status(101) + .with_stderr("[ERROR] package pattern(s) `*z` not found in workspace [..]") .run(); }