@@ -210,19 +210,7 @@ where
210
210
}
211
211
}
212
212
}
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) => {
226
214
if V :: SKIP_ASSOC_TYS {
227
215
// Visitors searching for minimal visibility/reachability want to
228
216
// conservatively approximate associated types like `Type::Alias`
@@ -232,13 +220,14 @@ where
232
220
return ControlFlow :: Continue ( ( ) ) ;
233
221
}
234
222
223
+ let kind = match kind {
224
+ ty:: Inherent | ty:: Projection => "associated type" ,
225
+ ty:: Weak => "type alias" ,
226
+ ty:: Opaque => unreachable ! ( ) ,
227
+ } ;
235
228
self . def_id_visitor . visit_def_id (
236
229
data. def_id ,
237
- match kind {
238
- ty:: Inherent => "associated type" ,
239
- ty:: Weak => "type alias" ,
240
- _ => unreachable ! ( ) ,
241
- } ,
230
+ kind,
242
231
& LazyDefPathStr { def_id : data. def_id , tcx } ,
243
232
) ?;
244
233
0 commit comments