mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
internal: don't expose impl details out of hir
This commit is contained in:
parent
76b60efbfb
commit
cfa3f679e9
2 changed files with 5 additions and 5 deletions
|
@ -2564,7 +2564,7 @@ impl Type {
|
|||
krate: Crate,
|
||||
traits_in_scope: &FxHashSet<TraitId>,
|
||||
name: Option<&Name>,
|
||||
mut callback: impl FnMut(&Ty, Function) -> Option<T>,
|
||||
mut callback: impl FnMut(Type, Function) -> Option<T>,
|
||||
) -> Option<T> {
|
||||
let _p = profile::span("iterate_method_candidates");
|
||||
let mut slot = None;
|
||||
|
@ -2575,7 +2575,7 @@ impl Type {
|
|||
name,
|
||||
&mut |ty, assoc_item_id| match assoc_item_id {
|
||||
AssocItemId::FunctionId(it) => {
|
||||
slot = callback(ty, it.into());
|
||||
slot = callback(self.derived(ty.clone()), it.into());
|
||||
slot.is_some()
|
||||
}
|
||||
AssocItemId::ConstId(_) | AssocItemId::TypeAliasId(_) => false,
|
||||
|
@ -2620,7 +2620,7 @@ impl Type {
|
|||
krate: Crate,
|
||||
traits_in_scope: &FxHashSet<TraitId>,
|
||||
name: Option<&Name>,
|
||||
mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>,
|
||||
mut callback: impl FnMut(Type, AssocItem) -> Option<T>,
|
||||
) -> Option<T> {
|
||||
let _p = profile::span("iterate_path_candidates");
|
||||
let mut slot = None;
|
||||
|
@ -2630,7 +2630,7 @@ impl Type {
|
|||
traits_in_scope,
|
||||
name,
|
||||
&mut |ty, assoc_item_id| {
|
||||
slot = callback(ty, assoc_item_id.into());
|
||||
slot = callback(self.derived(ty.clone()), assoc_item_id.into());
|
||||
slot.is_some()
|
||||
},
|
||||
);
|
||||
|
|
|
@ -410,7 +410,7 @@ pub enum LookupMode {
|
|||
// This would be nicer if it just returned an iterator, but that runs into
|
||||
// lifetime problems, because we need to borrow temp `CrateImplDefs`.
|
||||
// FIXME add a context type here?
|
||||
pub fn iterate_method_candidates<T>(
|
||||
pub fn iterate_method_candidates<T>(
|
||||
ty: &Canonical<Ty>,
|
||||
db: &dyn HirDatabase,
|
||||
env: Arc<TraitEnvironment>,
|
||||
|
|
Loading…
Reference in a new issue