File tree 2 files changed +4
-15
lines changed
2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -2613,19 +2613,6 @@ impl<'tcx> TyCtxt<'tcx> {
2613
2613
matches ! ( self . trait_of_item( def_id) , Some ( trait_id) if self . has_attr( trait_id, sym:: const_trait) )
2614
2614
}
2615
2615
2616
- pub fn impl_trait_in_trait_parent_fn ( self , mut def_id : DefId ) -> DefId {
2617
- match self . opt_rpitit_info ( def_id) {
2618
- Some ( ImplTraitInTraitData :: Trait { fn_def_id, .. } )
2619
- | Some ( ImplTraitInTraitData :: Impl { fn_def_id, .. } ) => fn_def_id,
2620
- None => {
2621
- while let def_kind = self . def_kind ( def_id) && def_kind != DefKind :: AssocFn {
2622
- def_id = self . parent ( def_id) ;
2623
- }
2624
- def_id
2625
- }
2626
- }
2627
- }
2628
-
2629
2616
/// Returns the `DefId` of the item within which the `impl Trait` is declared.
2630
2617
/// For type-alias-impl-trait this is the `type` alias.
2631
2618
/// For impl-trait-in-assoc-type this is the assoc type.
Original file line number Diff line number Diff line change @@ -179,8 +179,10 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> {
179
179
180
180
fn visit_ty ( & mut self , ty : Ty < ' tcx > ) -> std:: ops:: ControlFlow < Self :: BreakTy > {
181
181
if let ty:: Alias ( ty:: Projection , unshifted_alias_ty) = * ty. kind ( )
182
- && self . tcx . is_impl_trait_in_trait ( unshifted_alias_ty. def_id )
183
- && self . tcx . impl_trait_in_trait_parent_fn ( unshifted_alias_ty. def_id ) == self . fn_def_id
182
+ && let Some ( ty:: ImplTraitInTraitData :: Trait { fn_def_id, .. }
183
+ | ty:: ImplTraitInTraitData :: Impl { fn_def_id, .. } )
184
+ = self . tcx . opt_rpitit_info ( unshifted_alias_ty. def_id )
185
+ && fn_def_id == self . fn_def_id
184
186
&& self . seen . insert ( unshifted_alias_ty. def_id )
185
187
{
186
188
// We have entered some binders as we've walked into the
You can’t perform that action at this time.
0 commit comments