@@ -210,19 +210,7 @@ where
210210 }
211211 }
212212 }
213- ty:: Alias ( ty:: Projection , proj) => {
214- if V :: SKIP_ASSOC_TYS {
215- // Visitors searching for minimal visibility/reachability want to
216- // conservatively approximate associated types like `<Type as Trait>::Alias`
217- // as visible/reachable even if both `Type` and `Trait` are private.
218- // Ideally, associated types should be substituted in the same way as
219- // free type aliases, but this isn't done yet.
220- return ControlFlow :: Continue ( ( ) ) ;
221- }
222- // This will also visit args if necessary, so we don't need to recurse.
223- return self . visit_projection_ty ( proj) ;
224- }
225- ty:: Alias ( kind @ ( ty:: Inherent | ty:: Weak ) , data) => {
213+ ty:: Alias ( kind @ ( ty:: Inherent | ty:: Weak | ty:: Projection ) , data) => {
226214 if V :: SKIP_ASSOC_TYS {
227215 // Visitors searching for minimal visibility/reachability want to
228216 // conservatively approximate associated types like `Type::Alias`
@@ -232,13 +220,14 @@ where
232220 return ControlFlow :: Continue ( ( ) ) ;
233221 }
234222
223+ let kind = match kind {
224+ ty:: Inherent | ty:: Projection => "associated type" ,
225+ ty:: Weak => "type alias" ,
226+ ty:: Opaque => unreachable ! ( ) ,
227+ } ;
235228 self . def_id_visitor . visit_def_id (
236229 data. def_id ,
237- match kind {
238- ty:: Inherent => "associated type" ,
239- ty:: Weak => "type alias" ,
240- _ => unreachable ! ( ) ,
241- } ,
230+ kind,
242231 & LazyDefPathStr { def_id : data. def_id , tcx } ,
243232 ) ?;
244233
0 commit comments