File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2553,11 +2553,17 @@ impl<'tcx> TyCtxt<'tcx> {
2553
2553
}
2554
2554
2555
2555
pub fn impl_trait_in_trait_parent_fn ( self , mut def_id : DefId ) -> DefId {
2556
- while let def_kind = self . def_kind ( def_id) && def_kind != DefKind :: AssocFn {
2557
- debug_assert_eq ! ( def_kind, DefKind :: ImplTraitPlaceholder ) ;
2558
- def_id = self . parent ( def_id) ;
2556
+ match self . opt_rpitit_info ( def_id) {
2557
+ Some ( ImplTraitInTraitData :: Trait { fn_def_id, .. } )
2558
+ | Some ( ImplTraitInTraitData :: Impl { fn_def_id, .. } ) => fn_def_id,
2559
+ None => {
2560
+ while let def_kind = self . def_kind ( def_id) && def_kind != DefKind :: AssocFn {
2561
+ debug_assert_eq ! ( def_kind, DefKind :: ImplTraitPlaceholder ) ;
2562
+ def_id = self . parent ( def_id) ;
2563
+ }
2564
+ def_id
2565
+ }
2559
2566
}
2560
- def_id
2561
2567
}
2562
2568
2563
2569
pub fn impl_method_has_trait_impl_trait_tys ( self , def_id : DefId ) -> bool {
You can’t perform that action at this time.
0 commit comments