mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +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,
|
krate: Crate,
|
||||||
traits_in_scope: &FxHashSet<TraitId>,
|
traits_in_scope: &FxHashSet<TraitId>,
|
||||||
name: Option<&Name>,
|
name: Option<&Name>,
|
||||||
mut callback: impl FnMut(&Ty, Function) -> Option<T>,
|
mut callback: impl FnMut(Type, Function) -> Option<T>,
|
||||||
) -> Option<T> {
|
) -> Option<T> {
|
||||||
let _p = profile::span("iterate_method_candidates");
|
let _p = profile::span("iterate_method_candidates");
|
||||||
let mut slot = None;
|
let mut slot = None;
|
||||||
|
@ -2575,7 +2575,7 @@ impl Type {
|
||||||
name,
|
name,
|
||||||
&mut |ty, assoc_item_id| match assoc_item_id {
|
&mut |ty, assoc_item_id| match assoc_item_id {
|
||||||
AssocItemId::FunctionId(it) => {
|
AssocItemId::FunctionId(it) => {
|
||||||
slot = callback(ty, it.into());
|
slot = callback(self.derived(ty.clone()), it.into());
|
||||||
slot.is_some()
|
slot.is_some()
|
||||||
}
|
}
|
||||||
AssocItemId::ConstId(_) | AssocItemId::TypeAliasId(_) => false,
|
AssocItemId::ConstId(_) | AssocItemId::TypeAliasId(_) => false,
|
||||||
|
@ -2620,7 +2620,7 @@ impl Type {
|
||||||
krate: Crate,
|
krate: Crate,
|
||||||
traits_in_scope: &FxHashSet<TraitId>,
|
traits_in_scope: &FxHashSet<TraitId>,
|
||||||
name: Option<&Name>,
|
name: Option<&Name>,
|
||||||
mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>,
|
mut callback: impl FnMut(Type, AssocItem) -> Option<T>,
|
||||||
) -> Option<T> {
|
) -> Option<T> {
|
||||||
let _p = profile::span("iterate_path_candidates");
|
let _p = profile::span("iterate_path_candidates");
|
||||||
let mut slot = None;
|
let mut slot = None;
|
||||||
|
@ -2630,7 +2630,7 @@ impl Type {
|
||||||
traits_in_scope,
|
traits_in_scope,
|
||||||
name,
|
name,
|
||||||
&mut |ty, assoc_item_id| {
|
&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()
|
slot.is_some()
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -410,7 +410,7 @@ pub enum LookupMode {
|
||||||
// This would be nicer if it just returned an iterator, but that runs into
|
// This would be nicer if it just returned an iterator, but that runs into
|
||||||
// lifetime problems, because we need to borrow temp `CrateImplDefs`.
|
// lifetime problems, because we need to borrow temp `CrateImplDefs`.
|
||||||
// FIXME add a context type here?
|
// FIXME add a context type here?
|
||||||
pub fn iterate_method_candidates<T>(
|
pub fn iterate_method_candidates<T>(
|
||||||
ty: &Canonical<Ty>,
|
ty: &Canonical<Ty>,
|
||||||
db: &dyn HirDatabase,
|
db: &dyn HirDatabase,
|
||||||
env: Arc<TraitEnvironment>,
|
env: Arc<TraitEnvironment>,
|
||||||
|
|
Loading…
Reference in a new issue