File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -295,18 +295,27 @@ where
295
295
}
296
296
}
297
297
298
- if let TyKind :: Adt ( adt_def, _) = ty. kind ( ) {
299
- if !f ( adt_def. did ( ) ) {
300
- return ;
301
- }
302
- for field in adt_def. all_fields ( ) {
303
- let field_ty = tcx. type_of ( field. did ) ;
304
- for arg in field_ty. walk ( ) {
305
- if let GenericArgKind :: Type ( ty) = arg. unpack ( ) {
306
- walk_args_and_fields ( tcx, ty, f)
298
+ match ty. kind ( ) {
299
+ TyKind :: Adt ( adt_def, _) => {
300
+ if !f ( adt_def. did ( ) ) {
301
+ return ;
302
+ }
303
+ for field in adt_def. all_fields ( ) {
304
+ let field_ty = tcx. type_of ( field. did ) ;
305
+ for arg in field_ty. walk ( ) {
306
+ if let GenericArgKind :: Type ( ty) = arg. unpack ( ) {
307
+ walk_args_and_fields ( tcx, ty, f)
308
+ }
307
309
}
308
310
}
309
311
}
312
+ TyKind :: FnPtr ( sig) => {
313
+ let sig = tcx. erase_late_bound_regions ( * sig) ;
314
+ for ty in sig. inputs_and_output {
315
+ walk_args_and_fields ( tcx, ty, f)
316
+ }
317
+ }
318
+ _ => ( ) ,
310
319
}
311
320
}
312
321
You can’t perform that action at this time.
0 commit comments