From 6835fa386720c19cd0bf56b078b8f7d7dfa7dfc0 Mon Sep 17 00:00:00 2001 From: Jacob Finkelman Date: Mon, 13 Nov 2023 16:05:47 +0000 Subject: [PATCH] query{_vec} should use IndexSummary --- crates/resolver-tests/src/lib.rs | 5 +- crates/xtask-bump-check/src/xtask.rs | 1 + src/cargo/core/compiler/future_incompat.rs | 2 +- src/cargo/core/registry.rs | 48 +++++++++++++------ src/cargo/core/resolver/dep_cache.rs | 21 ++++---- src/cargo/core/resolver/errors.rs | 8 +++- src/cargo/ops/cargo_add/mod.rs | 14 +++++- .../ops/common_for_install_and_uninstall.rs | 7 ++- src/cargo/sources/directory.rs | 7 +-- src/cargo/sources/git/source.rs | 5 +- src/cargo/sources/mod.rs | 4 +- src/cargo/sources/path.rs | 7 +-- src/cargo/sources/registry/index.rs | 9 ++++ src/cargo/sources/registry/mod.rs | 13 +++-- src/cargo/sources/replaced.rs | 7 +-- src/cargo/sources/source.rs | 23 +++++---- 16 files changed, 122 insertions(+), 59 deletions(-) diff --git a/crates/resolver-tests/src/lib.rs b/crates/resolver-tests/src/lib.rs index e2cbcee62b6..507bff943c4 100644 --- a/crates/resolver-tests/src/lib.rs +++ b/crates/resolver-tests/src/lib.rs @@ -17,6 +17,7 @@ use cargo::core::Resolve; use cargo::core::{Dependency, PackageId, Registry, Summary}; use cargo::core::{GitReference, SourceId}; use cargo::sources::source::QueryKind; +use cargo::sources::IndexSummary; use cargo::util::{CargoResult, Config, Graph, IntoUrl, RustVersion}; use proptest::collection::{btree_map, vec}; @@ -131,7 +132,7 @@ pub fn resolve_with_config_raw( &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { for summary in self.list.iter() { let matched = match kind { @@ -140,7 +141,7 @@ pub fn resolve_with_config_raw( }; if matched { self.used.insert(summary.package_id()); - f(summary.clone()); + f(IndexSummary::Candidate(summary.clone())); } } Poll::Ready(Ok(())) diff --git a/crates/xtask-bump-check/src/xtask.rs b/crates/xtask-bump-check/src/xtask.rs index 9fbfb5374de..cba420f051b 100644 --- a/crates/xtask-bump-check/src/xtask.rs +++ b/crates/xtask-bump-check/src/xtask.rs @@ -377,6 +377,7 @@ fn check_crates_io<'a>( "`{name}@{current}` needs a bump because its should have a version newer than crates.io: {:?}`", possibilities .iter() + .map(|s| s.as_summary()) .map(|s| format!("{}@{}", s.name(), s.version())) .collect::>(), ); diff --git a/src/cargo/core/compiler/future_incompat.rs b/src/cargo/core/compiler/future_incompat.rs index af44940bd37..6f59d5989b4 100644 --- a/src/cargo/core/compiler/future_incompat.rs +++ b/src/cargo/core/compiler/future_incompat.rs @@ -348,7 +348,7 @@ fn get_updates(ws: &Workspace<'_>, package_ids: &BTreeSet) -> Option< for (pkg_id, summaries) in summaries { let mut updated_versions: Vec<_> = summaries .iter() - .map(|summary| summary.version()) + .map(|summary| summary.as_summary().version()) .filter(|version| *version > pkg_id.version()) .collect(); updated_versions.sort(); diff --git a/src/cargo/core/registry.rs b/src/cargo/core/registry.rs index a91f2986a94..a1fb1054da3 100644 --- a/src/cargo/core/registry.rs +++ b/src/cargo/core/registry.rs @@ -7,6 +7,7 @@ use crate::sources::config::SourceConfigMap; use crate::sources::source::QueryKind; use crate::sources::source::Source; use crate::sources::source::SourceMap; +use crate::sources::IndexSummary; use crate::util::errors::CargoResult; use crate::util::interning::InternedString; use crate::util::{CanonicalUrl, Config}; @@ -23,10 +24,14 @@ pub trait Registry { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll>; - fn query_vec(&mut self, dep: &Dependency, kind: QueryKind) -> Poll>> { + fn query_vec( + &mut self, + dep: &Dependency, + kind: QueryKind, + ) -> Poll>> { let mut ret = Vec::new(); self.query(dep, kind, &mut |s| ret.push(s)).map_ok(|()| ret) } @@ -337,6 +342,8 @@ impl<'cfg> PackageRegistry<'cfg> { } }; + let summaries = summaries.into_iter().map(|s| s.into_summary()).collect(); + let (summary, should_unlock) = match summary_for_patch(orig_patch, &locked, summaries, source) { Poll::Ready(x) => x, @@ -481,13 +488,15 @@ impl<'cfg> PackageRegistry<'cfg> { Ok(()) } - fn query_overrides(&mut self, dep: &Dependency) -> Poll>> { + fn query_overrides(&mut self, dep: &Dependency) -> Poll>> { for &s in self.overrides.iter() { let src = self.sources.get_mut(s).unwrap(); let dep = Dependency::new_override(dep.package_name(), s); - let mut results = ready!(src.query_vec(&dep, QueryKind::Exact))?; - if !results.is_empty() { - return Poll::Ready(Ok(Some(results.remove(0)))); + + let mut results = None; + ready!(src.query(&dep, QueryKind::Exact, &mut |s| results = Some(s)))?; + if results.is_some() { + return Poll::Ready(Ok(results)); } } Poll::Ready(Ok(None)) @@ -575,7 +584,7 @@ impl<'cfg> Registry for PackageRegistry<'cfg> { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { assert!(self.patches_locked); let (override_summary, n, to_warn) = { @@ -607,9 +616,9 @@ impl<'cfg> Registry for PackageRegistry<'cfg> { if patches.len() == 1 && dep.is_locked() { let patch = patches.remove(0); match override_summary { - Some(summary) => (summary, 1, Some(patch)), + Some(summary) => (summary, 1, Some(IndexSummary::Candidate(patch))), None => { - f(patch); + f(IndexSummary::Candidate(patch)); return Poll::Ready(Ok(())); } } @@ -646,7 +655,7 @@ impl<'cfg> Registry for PackageRegistry<'cfg> { // everything upstairs after locking the summary (None, Some(source)) => { for patch in patches.iter() { - f(patch.clone()); + f(IndexSummary::Candidate(patch.clone())); } // Our sources shouldn't ever come back to us with two @@ -658,14 +667,18 @@ impl<'cfg> Registry for PackageRegistry<'cfg> { // already selected, then we skip this `summary`. let locked = &self.locked; let all_patches = &self.patches_available; - let callback = &mut |summary: Summary| { + let callback = &mut |summary: IndexSummary| { for patch in patches.iter() { let patch = patch.package_id().version(); if summary.package_id().version() == patch { return; } } - f(lock(locked, all_patches, summary)) + f(IndexSummary::Candidate(lock( + locked, + all_patches, + summary.into_summary(), + ))) }; return source.query(dep, kind, callback); } @@ -702,9 +715,12 @@ impl<'cfg> Registry for PackageRegistry<'cfg> { "found an override with a non-locked list" ))); } else if let Some(summary) = to_warn { - self.warn_bad_override(&override_summary, &summary)?; + self.warn_bad_override(override_summary.as_summary(), summary.as_summary())?; } - f(self.lock(override_summary)); + f(IndexSummary::Candidate( + self.lock(override_summary.into_summary()), + )); + Poll::Ready(Ok(())) } @@ -887,6 +903,8 @@ fn summary_for_patch( Vec::new() }); + let orig_matches = orig_matches.into_iter().map(|s| s.into_summary()).collect(); + let summary = ready!(summary_for_patch(orig_patch, &None, orig_matches, source))?; // The unlocked version found a match. This returns a value to @@ -907,7 +925,7 @@ fn summary_for_patch( }); let mut vers = name_summaries .iter() - .map(|summary| summary.version()) + .map(|summary| summary.as_summary().version()) .collect::>(); let found = match vers.len() { 0 => format!(""), diff --git a/src/cargo/core/resolver/dep_cache.rs b/src/cargo/core/resolver/dep_cache.rs index 6c904c1483a..00a269482b7 100644 --- a/src/cargo/core/resolver/dep_cache.rs +++ b/src/cargo/core/resolver/dep_cache.rs @@ -105,7 +105,7 @@ impl<'a> RegistryQueryer<'a> { let mut ret = Vec::new(); let ready = self.registry.query(dep, QueryKind::Exact, &mut |s| { - ret.push(s); + ret.push(s.into_summary()); })?; if ready.is_pending() { self.registry_cache @@ -135,16 +135,19 @@ impl<'a> RegistryQueryer<'a> { return Poll::Pending; } }; - let s = summaries.next().ok_or_else(|| { - anyhow::format_err!( - "no matching package for override `{}` found\n\ + let s = summaries + .next() + .ok_or_else(|| { + anyhow::format_err!( + "no matching package for override `{}` found\n\ location searched: {}\n\ version required: {}", - spec, - dep.source_id(), - dep.version_req() - ) - })?; + spec, + dep.source_id(), + dep.version_req() + ) + })? + .into_summary(); let summaries = summaries.collect::>(); if !summaries.is_empty() { let bullets = summaries diff --git a/src/cargo/core/resolver/errors.rs b/src/cargo/core/resolver/errors.rs index 15a006ffba0..ae6c7fb8eec 100644 --- a/src/cargo/core/resolver/errors.rs +++ b/src/cargo/core/resolver/errors.rs @@ -228,7 +228,7 @@ pub(super) fn activation_error( let mut new_dep = dep.clone(); new_dep.set_version_req(OptVersionReq::Any); - let mut candidates = loop { + let candidates = loop { match registry.query_vec(&new_dep, QueryKind::Exact) { Poll::Ready(Ok(candidates)) => break candidates, Poll::Ready(Err(e)) => return to_resolve_err(e), @@ -239,6 +239,8 @@ pub(super) fn activation_error( } }; + let mut candidates: Vec<_> = candidates.into_iter().map(|s| s.into_summary()).collect(); + candidates.sort_unstable_by(|a, b| b.version().cmp(a.version())); let mut msg = if !candidates.is_empty() { @@ -303,7 +305,7 @@ pub(super) fn activation_error( } else { // Maybe the user mistyped the name? Like `dep-thing` when `Dep_Thing` // was meant. So we try asking the registry for a `fuzzy` search for suggestions. - let mut candidates = loop { + let candidates = loop { match registry.query_vec(&new_dep, QueryKind::Fuzzy) { Poll::Ready(Ok(candidates)) => break candidates, Poll::Ready(Err(e)) => return to_resolve_err(e), @@ -314,6 +316,8 @@ pub(super) fn activation_error( } }; + let mut candidates: Vec<_> = candidates.into_iter().map(|s| s.into_summary()).collect(); + candidates.sort_unstable_by_key(|a| a.name()); candidates.dedup_by(|a, b| a.name() == b.name()); let mut candidates: Vec<_> = candidates diff --git a/src/cargo/ops/cargo_add/mod.rs b/src/cargo/ops/cargo_add/mod.rs index 39e37b15666..5afc8d0c9d8 100644 --- a/src/cargo/ops/cargo_add/mod.rs +++ b/src/cargo/ops/cargo_add/mod.rs @@ -545,7 +545,7 @@ fn get_latest_dependency( unreachable!("registry dependencies required, found a workspace dependency"); } MaybeWorkspace::Other(query) => { - let mut possibilities = loop { + let possibilities = loop { match registry.query_vec(&query, QueryKind::Fuzzy) { std::task::Poll::Ready(res) => { break res?; @@ -554,6 +554,11 @@ fn get_latest_dependency( } }; + let mut possibilities: Vec<_> = possibilities + .into_iter() + .map(|s| s.into_summary()) + .collect(); + possibilities.sort_by_key(|s| { // Fallback to a pre-release if no official release is available by sorting them as // less. @@ -671,6 +676,12 @@ fn select_package( std::task::Poll::Pending => registry.block_until_ready()?, } }; + + let possibilities: Vec<_> = possibilities + .into_iter() + .map(|s| s.into_summary()) + .collect(); + match possibilities.len() { 0 => { let source = dependency @@ -889,6 +900,7 @@ fn populate_available_features( // in the lock file for a given version requirement. let lowest_common_denominator = possibilities .iter() + .map(|s| s.as_summary()) .min_by_key(|s| { // Fallback to a pre-release if no official release is available by sorting them as // more. diff --git a/src/cargo/ops/common_for_install_and_uninstall.rs b/src/cargo/ops/common_for_install_and_uninstall.rs index d1f9152be40..77eb431c9ce 100644 --- a/src/cargo/ops/common_for_install_and_uninstall.rs +++ b/src/cargo/ops/common_for_install_and_uninstall.rs @@ -552,7 +552,11 @@ where Poll::Pending => source.block_until_ready()?, } }; - match deps.iter().max_by_key(|p| p.package_id()) { + match deps + .iter() + .map(|s| s.as_summary()) + .max_by_key(|p| p.package_id()) + { Some(summary) => { if let (Some(current), Some(msrv)) = (current_rust_version, summary.rust_version()) { let msrv_req = msrv.to_caret_req(); @@ -571,6 +575,7 @@ where }; if let Some(alt) = msrv_deps .iter() + .map(|s| s.as_summary()) .filter(|summary| { summary .rust_version() diff --git a/src/cargo/sources/directory.rs b/src/cargo/sources/directory.rs index 7195fd72d65..01c3c43302e 100644 --- a/src/cargo/sources/directory.rs +++ b/src/cargo/sources/directory.rs @@ -3,10 +3,11 @@ use std::fmt::{self, Debug, Formatter}; use std::path::{Path, PathBuf}; use std::task::Poll; -use crate::core::{Dependency, Package, PackageId, SourceId, Summary}; +use crate::core::{Dependency, Package, PackageId, SourceId}; use crate::sources::source::MaybePackage; use crate::sources::source::QueryKind; use crate::sources::source::Source; +use crate::sources::IndexSummary; use crate::sources::PathSource; use crate::util::errors::CargoResult; use crate::util::Config; @@ -99,7 +100,7 @@ impl<'cfg> Source for DirectorySource<'cfg> { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { if !self.updated { return Poll::Pending; @@ -110,7 +111,7 @@ impl<'cfg> Source for DirectorySource<'cfg> { QueryKind::Fuzzy => true, }); for summary in matches.map(|pkg| pkg.summary().clone()) { - f(summary); + f(IndexSummary::Candidate(summary)); } Poll::Ready(Ok(())) } diff --git a/src/cargo/sources/git/source.rs b/src/cargo/sources/git/source.rs index c89bf346ceb..480bca34f17 100644 --- a/src/cargo/sources/git/source.rs +++ b/src/cargo/sources/git/source.rs @@ -3,11 +3,12 @@ use crate::core::global_cache_tracker; use crate::core::GitReference; use crate::core::SourceId; -use crate::core::{Dependency, Package, PackageId, Summary}; +use crate::core::{Dependency, Package, PackageId}; use crate::sources::git::utils::GitRemote; use crate::sources::source::MaybePackage; use crate::sources::source::QueryKind; use crate::sources::source::Source; +use crate::sources::IndexSummary; use crate::sources::PathSource; use crate::util::cache_lock::CacheLockMode; use crate::util::errors::CargoResult; @@ -192,7 +193,7 @@ impl<'cfg> Source for GitSource<'cfg> { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { if let Some(src) = self.path_source.as_mut() { src.query(dep, kind, f) diff --git a/src/cargo/sources/mod.rs b/src/cargo/sources/mod.rs index 7da1d652d2e..1d2f51a3718 100644 --- a/src/cargo/sources/mod.rs +++ b/src/cargo/sources/mod.rs @@ -30,7 +30,9 @@ pub use self::config::SourceConfigMap; pub use self::directory::DirectorySource; pub use self::git::GitSource; pub use self::path::PathSource; -pub use self::registry::{RegistrySource, CRATES_IO_DOMAIN, CRATES_IO_INDEX, CRATES_IO_REGISTRY}; +pub use self::registry::{ + IndexSummary, RegistrySource, CRATES_IO_DOMAIN, CRATES_IO_INDEX, CRATES_IO_REGISTRY, +}; pub use self::replaced::ReplacedSource; pub mod config; diff --git a/src/cargo/sources/path.rs b/src/cargo/sources/path.rs index 0cc6399766e..bbdb78732ec 100644 --- a/src/cargo/sources/path.rs +++ b/src/cargo/sources/path.rs @@ -3,11 +3,12 @@ use std::fmt::{self, Debug, Formatter}; use std::path::{Path, PathBuf}; use std::task::Poll; -use crate::core::{Dependency, Package, PackageId, SourceId, Summary}; +use crate::core::{Dependency, Package, PackageId, SourceId}; use crate::ops; use crate::sources::source::MaybePackage; use crate::sources::source::QueryKind; use crate::sources::source::Source; +use crate::sources::IndexSummary; use crate::util::{internal, CargoResult, Config}; use anyhow::Context as _; use cargo_util::paths; @@ -542,7 +543,7 @@ impl<'cfg> Source for PathSource<'cfg> { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { self.update()?; for s in self.packages.iter().map(|p| p.summary()) { @@ -551,7 +552,7 @@ impl<'cfg> Source for PathSource<'cfg> { QueryKind::Fuzzy => true, }; if matched { - f(s.clone()) + f(IndexSummary::Candidate(s.clone())) } } Poll::Ready(Ok(())) diff --git a/src/cargo/sources/registry/index.rs b/src/cargo/sources/registry/index.rs index 00f21d669e6..bb3edb1e756 100644 --- a/src/cargo/sources/registry/index.rs +++ b/src/cargo/sources/registry/index.rs @@ -223,6 +223,15 @@ impl IndexSummary { } } + pub fn map_summary(self, f: impl Fn(Summary) -> Summary) -> Self { + match self { + IndexSummary::Candidate(s) => IndexSummary::Candidate(f(s)), + IndexSummary::Yanked(s) => IndexSummary::Yanked(f(s)), + IndexSummary::Offline(s) => IndexSummary::Offline(f(s)), + IndexSummary::Unsupported(s, v) => IndexSummary::Unsupported(f(s), v.clone()), + } + } + /// Extract the package id from any variant pub fn package_id(&self) -> PackageId { match self { diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index f884eec30b8..0d558b88033 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -202,7 +202,7 @@ use tracing::debug; use crate::core::dependency::Dependency; use crate::core::global_cache_tracker; -use crate::core::{Package, PackageId, SourceId, Summary}; +use crate::core::{Package, PackageId, SourceId}; use crate::sources::source::MaybePackage; use crate::sources::source::QueryKind; use crate::sources::source::Source; @@ -437,6 +437,7 @@ pub enum MaybeLock { mod download; mod http_remote; mod index; +pub use index::IndexSummary; mod local; mod remote; @@ -730,7 +731,7 @@ impl<'cfg> Source for RegistrySource<'cfg> { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { let mut req = dep.version_req().clone(); @@ -756,7 +757,7 @@ impl<'cfg> Source for RegistrySource<'cfg> { if dep.matches(s.as_summary()) { // We are looking for a package from a lock file so we do not care about yank called = true; - f(s.into_summary()); + f(s); } },))?; if called { @@ -781,7 +782,7 @@ impl<'cfg> Source for RegistrySource<'cfg> { if matched && (!s.is_yanked() || self.yanked_whitelist.contains(&s.package_id())) { - f(s.into_summary()); + f(s); called = true; } }))?; @@ -806,9 +807,7 @@ impl<'cfg> Source for RegistrySource<'cfg> { } any_pending |= self .index - .query_inner(name_permutation, &req, &mut *self.ops, &mut |s| { - f(s.into_summary()); - })? + .query_inner(name_permutation, &req, &mut *self.ops, f)? .is_pending(); } } diff --git a/src/cargo/sources/replaced.rs b/src/cargo/sources/replaced.rs index f224e073d33..8c38a52413f 100644 --- a/src/cargo/sources/replaced.rs +++ b/src/cargo/sources/replaced.rs @@ -1,7 +1,8 @@ -use crate::core::{Dependency, Package, PackageId, SourceId, Summary}; +use crate::core::{Dependency, Package, PackageId, SourceId}; use crate::sources::source::MaybePackage; use crate::sources::source::QueryKind; use crate::sources::source::Source; +use crate::sources::IndexSummary; use crate::util::errors::CargoResult; use std::task::Poll; @@ -59,14 +60,14 @@ impl<'cfg> Source for ReplacedSource<'cfg> { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { let (replace_with, to_replace) = (self.replace_with, self.to_replace); let dep = dep.clone().map_source(to_replace, replace_with); self.inner .query(&dep, kind, &mut |summary| { - f(summary.map_source(replace_with, to_replace)) + f(summary.map_summary(|s| s.map_source(replace_with, to_replace))) }) .map_err(|e| { e.context(format!( diff --git a/src/cargo/sources/source.rs b/src/cargo/sources/source.rs index 5a3439e5d76..dd6619e59a7 100644 --- a/src/cargo/sources/source.rs +++ b/src/cargo/sources/source.rs @@ -6,7 +6,8 @@ use std::task::Poll; use crate::core::package::PackageSet; use crate::core::SourceId; -use crate::core::{Dependency, Package, PackageId, Summary}; +use crate::core::{Dependency, Package, PackageId}; +use crate::sources::IndexSummary; use crate::util::{CargoResult, Config}; /// An abstraction of different sources of Cargo packages. @@ -36,11 +37,11 @@ pub trait Source { self.source_id() } - /// Returns whether or not this source will return [`Summary`] items with + /// Returns whether or not this source will return [`IndexSummary`] items with /// checksums listed. fn supports_checksums(&self) -> bool; - /// Returns whether or not this source will return [`Summary`] items with + /// Returns whether or not this source will return [`IndexSummary`] items with /// the `precise` field in the [`SourceId`] listed. fn requires_precise(&self) -> bool; @@ -50,17 +51,21 @@ pub trait Source { /// wait until package information become available. Otherwise any query /// may return a [`Poll::Pending`]. /// - /// The `f` argument is expected to get called when any [`Summary`] becomes available. + /// The `f` argument is expected to get called when any [`IndexSummary`] becomes available. fn query( &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll>; - /// Gathers the result from [`Source::query`] as a list of [`Summary`] items + /// Gathers the result from [`Source::query`] as a list of [`IndexSummary`] items /// when they become available. - fn query_vec(&mut self, dep: &Dependency, kind: QueryKind) -> Poll>> { + fn query_vec( + &mut self, + dep: &Dependency, + kind: QueryKind, + ) -> Poll>> { let mut ret = Vec::new(); self.query(dep, kind, &mut |s| ret.push(s)).map_ok(|_| ret) } @@ -215,7 +220,7 @@ impl<'a, T: Source + ?Sized + 'a> Source for Box { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { (**self).query(dep, kind, f) } @@ -287,7 +292,7 @@ impl<'a, T: Source + ?Sized + 'a> Source for &'a mut T { &mut self, dep: &Dependency, kind: QueryKind, - f: &mut dyn FnMut(Summary), + f: &mut dyn FnMut(IndexSummary), ) -> Poll> { (**self).query(dep, kind, f) }