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

@ -55,10 +55,10 @@ fn check_mod_impl_wf(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
let min_specialization = tcx.features().min_specialization;
let module = tcx.hir_module_items(module_def_id);
for id in module.items() {
if matches!(tcx.def_kind(id.def_id), DefKind::Impl) {
enforce_impl_params_are_constrained(tcx, id.def_id.def_id);
if matches!(tcx.def_kind(id.owner_id), DefKind::Impl) {
enforce_impl_params_are_constrained(tcx, id.owner_id.def_id);
if min_specialization {
check_min_specialization(tcx, id.def_id.def_id);
check_min_specialization(tcx, id.owner_id.def_id);
}
}
}