@@ -290,7 +290,7 @@ fn foreign_mentioned_tys(tcx: TyCtxt) -> HashSet<DefId> {
290
290
_ => None ,
291
291
} )
292
292
{
293
- walk_args_and_fields ( tcx, ty, & mut |did| foreign_mentioned_tys. insert ( did) ) ;
293
+ walk_adts ( tcx, ty, & mut |did| foreign_mentioned_tys. insert ( did) ) ;
294
294
}
295
295
foreign_mentioned_tys
296
296
}
@@ -302,15 +302,15 @@ fn foreign_mentioned_tys(tcx: TyCtxt) -> HashSet<DefId> {
302
302
/// of a type are finite in length.
303
303
/// We only look for ADTs rather than other FFI-crossing types because ADTs
304
304
/// are the only nominal ones, which are the ones that we may rewrite.
305
- fn walk_args_and_fields < ' tcx , F > ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , f : & mut F )
305
+ fn walk_adts < ' tcx , F > ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > , f : & mut F )
306
306
where
307
307
F : FnMut ( DefId ) -> bool ,
308
308
{
309
309
// the first type encountered in the walk is `ty`, and the
310
310
// relevant handling for that is below, so we can skip it here
311
311
for arg in ty. walk ( ) . skip ( 1 ) {
312
312
if let GenericArgKind :: Type ( ty) = arg. unpack ( ) {
313
- walk_args_and_fields ( tcx, ty, f) ;
313
+ walk_adts ( tcx, ty, f) ;
314
314
}
315
315
}
316
316
@@ -320,7 +320,7 @@ where
320
320
}
321
321
for field in adt_def. all_fields ( ) {
322
322
let field_ty = tcx. type_of ( field. did ) ;
323
- walk_args_and_fields ( tcx, field_ty, f) ;
323
+ walk_adts ( tcx, field_ty, f) ;
324
324
}
325
325
}
326
326
}
0 commit comments