Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 8077576

Browse files
authored
Merge pull request #135 from Xanewok/no-lib-target
Properly warn if a package lacks [lib] target
2 parents 78f0426 + 6a9daf8 commit 8077576

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bin/cargo_semver.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ fn run(config: &cargo::Config, matches: &getopts::Matches) -> Result<()> {
119119
};
120120
let name = current.package.name().to_owned();
121121

122+
if !current.package.targets().iter().any(|t| t.is_lib()) {
123+
return Err(anyhow::anyhow!(
124+
"package `{}` lacks required [lib] target",
125+
&name
126+
));
127+
}
128+
122129
// TODO: JSON output here
123130
if matches.opt_present("show-public") {
124131
let (current_rlib, current_deps_output) =

0 commit comments

Comments
 (0)