Skip to content

Commit 8d64640

Browse files
committed
Crate checksum lookup includes build metadata
1 parent 3a73377 commit 8d64640

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/cargo/sources/registry/index.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,9 @@ impl<'cfg> RegistryIndex<'cfg> {
379379
pub fn hash(&mut self, pkg: PackageId, load: &mut dyn RegistryData) -> Poll<CargoResult<&str>> {
380380
let req = OptVersionReq::exact(pkg.version());
381381
let summary = self.summaries(&pkg.name(), &req, load)?;
382-
let summary = ready!(summary).next();
382+
let summary = ready!(summary)
383+
.filter(|s| s.summary.version() == pkg.version())
384+
.next();
383385
Poll::Ready(Ok(summary
384386
.ok_or_else(|| internal(format!("no hash listed for {}", pkg)))?
385387
.summary
@@ -623,10 +625,10 @@ impl<'cfg> RegistryIndex<'cfg> {
623625
load: &mut dyn RegistryData,
624626
) -> Poll<CargoResult<bool>> {
625627
let req = OptVersionReq::exact(pkg.version());
626-
let found = self
627-
.summaries(&pkg.name(), &req, load)
628-
.map_ok(|mut p| p.any(|summary| summary.yanked));
629-
found
628+
let found = ready!(self.summaries(&pkg.name(), &req, load))?
629+
.filter(|s| s.summary.version() == pkg.version())
630+
.any(|summary| summary.yanked);
631+
Poll::Ready(Ok(found))
630632
}
631633
}
632634

src/cargo/sources/registry/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ impl<'cfg> RegistrySource<'cfg> {
694694
.summaries(&package.name(), &req, &mut *self.ops)?
695695
.expect("a downloaded dep now pending!?")
696696
.map(|s| s.summary.clone())
697+
.filter(|s| s.version() == package.version())
697698
.next()
698699
.expect("summary not found");
699700
if let Some(cksum) = summary_with_cksum.checksum() {

0 commit comments

Comments
 (0)