We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7ff31f commit b1642b5Copy full SHA for b1642b5
src/cargo/util_schemas/core/package_id_spec.rs
@@ -98,6 +98,9 @@ impl PackageIdSpec {
98
Some(version) => Some(version.parse::<PartialVersion>()?),
99
None => None,
100
};
101
+ if name.is_empty() {
102
+ bail!("package ID specification must have a name: `{spec}`");
103
+ }
104
validate_package_name(name, "pkgid", "")?;
105
Ok(PackageIdSpec {
106
name: String::from(name),
@@ -597,6 +600,6 @@ mod tests {
597
600
"sparse+https://github.com/rust-lang/cargo#0.52.0?branch=dev"
598
601
)
599
602
.is_err());
- assert!(PackageIdSpec::parse("@1.2.3").is_ok());
603
+ assert!(PackageIdSpec::parse("@1.2.3").is_err());
604
}
605
0 commit comments