Skip to content

Commit cfa3f67

Browse files
committed
internal: don't expose impl details out of hir
1 parent 76b60ef commit cfa3f67

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/hir/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ impl Type {
25642564
krate: Crate,
25652565
traits_in_scope: &FxHashSet<TraitId>,
25662566
name: Option<&Name>,
2567-
mut callback: impl FnMut(&Ty, Function) -> Option<T>,
2567+
mut callback: impl FnMut(Type, Function) -> Option<T>,
25682568
) -> Option<T> {
25692569
let _p = profile::span("iterate_method_candidates");
25702570
let mut slot = None;
@@ -2575,7 +2575,7 @@ impl Type {
25752575
name,
25762576
&mut |ty, assoc_item_id| match assoc_item_id {
25772577
AssocItemId::FunctionId(it) => {
2578-
slot = callback(ty, it.into());
2578+
slot = callback(self.derived(ty.clone()), it.into());
25792579
slot.is_some()
25802580
}
25812581
AssocItemId::ConstId(_) | AssocItemId::TypeAliasId(_) => false,
@@ -2620,7 +2620,7 @@ impl Type {
26202620
krate: Crate,
26212621
traits_in_scope: &FxHashSet<TraitId>,
26222622
name: Option<&Name>,
2623-
mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>,
2623+
mut callback: impl FnMut(Type, AssocItem) -> Option<T>,
26242624
) -> Option<T> {
26252625
let _p = profile::span("iterate_path_candidates");
26262626
let mut slot = None;
@@ -2630,7 +2630,7 @@ impl Type {
26302630
traits_in_scope,
26312631
name,
26322632
&mut |ty, assoc_item_id| {
2633-
slot = callback(ty, assoc_item_id.into());
2633+
slot = callback(self.derived(ty.clone()), assoc_item_id.into());
26342634
slot.is_some()
26352635
},
26362636
);

crates/hir_ty/src/method_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ pub enum LookupMode {
410410
// This would be nicer if it just returned an iterator, but that runs into
411411
// lifetime problems, because we need to borrow temp `CrateImplDefs`.
412412
// FIXME add a context type here?
413-
pub fn iterate_method_candidates<T>(
413+
pub fn iterate_method_candidates<T>(
414414
ty: &Canonical<Ty>,
415415
db: &dyn HirDatabase,
416416
env: Arc<TraitEnvironment>,

0 commit comments

Comments
 (0)