@@ -2564,7 +2564,7 @@ impl Type {
2564
2564
krate : Crate ,
2565
2565
traits_in_scope : & FxHashSet < TraitId > ,
2566
2566
name : Option < & Name > ,
2567
- mut callback : impl FnMut ( & Ty , Function ) -> Option < T > ,
2567
+ mut callback : impl FnMut ( Type , Function ) -> Option < T > ,
2568
2568
) -> Option < T > {
2569
2569
let _p = profile:: span ( "iterate_method_candidates" ) ;
2570
2570
let mut slot = None ;
@@ -2575,7 +2575,7 @@ impl Type {
2575
2575
name,
2576
2576
& mut |ty, assoc_item_id| match assoc_item_id {
2577
2577
AssocItemId :: FunctionId ( it) => {
2578
- slot = callback ( ty , it. into ( ) ) ;
2578
+ slot = callback ( self . derived ( ty . clone ( ) ) , it. into ( ) ) ;
2579
2579
slot. is_some ( )
2580
2580
}
2581
2581
AssocItemId :: ConstId ( _) | AssocItemId :: TypeAliasId ( _) => false ,
@@ -2620,7 +2620,7 @@ impl Type {
2620
2620
krate : Crate ,
2621
2621
traits_in_scope : & FxHashSet < TraitId > ,
2622
2622
name : Option < & Name > ,
2623
- mut callback : impl FnMut ( & Ty , AssocItem ) -> Option < T > ,
2623
+ mut callback : impl FnMut ( Type , AssocItem ) -> Option < T > ,
2624
2624
) -> Option < T > {
2625
2625
let _p = profile:: span ( "iterate_path_candidates" ) ;
2626
2626
let mut slot = None ;
@@ -2630,7 +2630,7 @@ impl Type {
2630
2630
traits_in_scope,
2631
2631
name,
2632
2632
& mut |ty, assoc_item_id| {
2633
- slot = callback ( ty , assoc_item_id. into ( ) ) ;
2633
+ slot = callback ( self . derived ( ty . clone ( ) ) , assoc_item_id. into ( ) ) ;
2634
2634
slot. is_some ( )
2635
2635
} ,
2636
2636
) ;
0 commit comments