1
Fork 0

Rename some OwnerId fields.

spastorino noticed some silly expressions like `item_id.def_id.def_id`.

This commit renames several `def_id: OwnerId` fields as `owner_id`, so
those expressions become `item_id.owner_id.def_id`.

`item_id.owner_id.local_def_id` would be even clearer, but the use of
`def_id` for values of type `LocalDefId` is *very* widespread, so I left
that alone.
This commit is contained in:
Nicholas Nethercote 2022-10-27 14:02:18 +11:00
parent 33b55ac39f
commit c8c25ce5a1
107 changed files with 618 additions and 603 deletions

View file

@ -26,19 +26,19 @@ pub fn report_symbol_names(tcx: TyCtxt<'_>) {
let crate_items = tcx.hir_crate_items(());
for id in crate_items.items() {
symbol_names.process_attrs(id.def_id.def_id);
symbol_names.process_attrs(id.owner_id.def_id);
}
for id in crate_items.trait_items() {
symbol_names.process_attrs(id.def_id.def_id);
symbol_names.process_attrs(id.owner_id.def_id);
}
for id in crate_items.impl_items() {
symbol_names.process_attrs(id.def_id.def_id);
symbol_names.process_attrs(id.owner_id.def_id);
}
for id in crate_items.foreign_items() {
symbol_names.process_attrs(id.def_id.def_id);
symbol_names.process_attrs(id.owner_id.def_id);
}
})
}