Skip to content

Commit 0a4557d

Browse files
committed
walk_args_and_fields -> walk_adts
1 parent 8e34144 commit 0a4557d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

c2rust-analyze/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ fn foreign_mentioned_tys(tcx: TyCtxt) -> HashSet<DefId> {
290290
_ => None,
291291
})
292292
{
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));
294294
}
295295
foreign_mentioned_tys
296296
}
@@ -302,15 +302,15 @@ fn foreign_mentioned_tys(tcx: TyCtxt) -> HashSet<DefId> {
302302
/// of a type are finite in length.
303303
/// We only look for ADTs rather than other FFI-crossing types because ADTs
304304
/// 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)
306306
where
307307
F: FnMut(DefId) -> bool,
308308
{
309309
// the first type encountered in the walk is `ty`, and the
310310
// relevant handling for that is below, so we can skip it here
311311
for arg in ty.walk().skip(1) {
312312
if let GenericArgKind::Type(ty) = arg.unpack() {
313-
walk_args_and_fields(tcx, ty, f);
313+
walk_adts(tcx, ty, f);
314314
}
315315
}
316316

@@ -320,7 +320,7 @@ where
320320
}
321321
for field in adt_def.all_fields() {
322322
let field_ty = tcx.type_of(field.did);
323-
walk_args_and_fields(tcx, field_ty, f);
323+
walk_adts(tcx, field_ty, f);
324324
}
325325
}
326326
}

0 commit comments

Comments
 (0)