Skip to content

Commit 22619a2

Browse files
committed
cargo fetch: Display workspace warnings.
1 parent 6aca041 commit 22619a2

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/cargo/ops/cargo_fetch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub fn fetch<'a>(
1616
ws: &Workspace<'a>,
1717
options: &FetchOptions<'a>,
1818
) -> CargoResult<(Resolve, PackageSet<'a>)> {
19+
ws.emit_warnings()?;
1920
let (packages, resolve) = ops::resolve_ws(ws)?;
2021

2122
let jobs = Some(1);

tests/testsuite/fetch.rs

+19
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,22 @@ fn fetch_platform_specific_dependencies() {
112112
.with_stderr_does_not_contain("[DOWNLOADED] d1 v1.2.3 [..]")
113113
.run();
114114
}
115+
116+
#[cargo_test]
117+
fn fetch_warning() {
118+
let p = project()
119+
.file(
120+
"Cargo.toml",
121+
r#"
122+
[package]
123+
name = "foo"
124+
version = "1.0.0"
125+
misspelled = "wut"
126+
"#,
127+
)
128+
.file("src/lib.rs", "")
129+
.build();
130+
p.cargo("fetch")
131+
.with_stderr("[WARNING] unused manifest key: package.misspelled")
132+
.run();
133+
}

0 commit comments

Comments
 (0)