Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
| -rw-r--r-- | crates/hir/src/lib.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 163a319443..6206a541c1 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -3339,12 +3339,10 @@ impl Type { .map(move |ty| self.derived(ty)) } - pub fn iterate_method_candidates<T>( + pub fn iterate_method_candidates_with_traits<T>( &self, db: &dyn HirDatabase, scope: &SemanticsScope<'_>, - // FIXME this can be retrieved from `scope`, except autoimport uses this - // to specify a different set, so the method needs to be split traits_in_scope: &FxHashSet<TraitId>, with_local_impls: Option<Module>, name: Option<&Name>, @@ -3372,6 +3370,24 @@ impl Type { slot } + pub fn iterate_method_candidates<T>( + &self, + db: &dyn HirDatabase, + scope: &SemanticsScope<'_>, + with_local_impls: Option<Module>, + name: Option<&Name>, + callback: impl FnMut(Function) -> Option<T>, + ) -> Option<T> { + self.iterate_method_candidates_with_traits( + db, + scope, + &scope.visible_traits().0, + with_local_impls, + name, + callback, + ) + } + fn iterate_method_candidates_dyn( &self, db: &dyn HirDatabase, |