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> {
25532553 }
25542554
25552555 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+ }
25592566 }
2560- def_id
25612567 }
25622568
25632569 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