diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-10-27 14:02:18 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-10-29 20:28:38 +1100 |
| commit | c8c25ce5a15f3f50439b1d746fd507c6e28abe18 (patch) | |
| tree | cd3cfcb3970619de6f8c4bdc31838ba24681d1ca /compiler/rustc_passes/src/lang_items.rs | |
| parent | 33b55ac39fa633d0983fad014469e1036669bf28 (diff) | |
| download | rust-c8c25ce5a15f3f50439b1d746fd507c6e28abe18.tar.gz rust-c8c25ce5a15f3f50439b1d746fd507c6e28abe18.zip | |
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.
Diffstat (limited to 'compiler/rustc_passes/src/lang_items.rs')
| -rw-r--r-- | compiler/rustc_passes/src/lang_items.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_passes/src/lang_items.rs b/compiler/rustc_passes/src/lang_items.rs index 71b0735192a..df811be2a7e 100644 --- a/compiler/rustc_passes/src/lang_items.rs +++ b/compiler/rustc_passes/src/lang_items.rs @@ -217,9 +217,9 @@ fn get_lang_items(tcx: TyCtxt<'_>, (): ()) -> LanguageItems { let crate_items = tcx.hir_crate_items(()); for id in crate_items.items() { - collector.check_for_lang(Target::from_def_kind(tcx.def_kind(id.def_id)), id.hir_id()); + collector.check_for_lang(Target::from_def_kind(tcx.def_kind(id.owner_id)), id.hir_id()); - if matches!(tcx.def_kind(id.def_id), DefKind::Enum) { + if matches!(tcx.def_kind(id.owner_id), DefKind::Enum) { let item = tcx.hir().item(id); if let hir::ItemKind::Enum(def, ..) = &item.kind { for variant in def.variants { |
