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/layout_test.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/layout_test.rs')
| -rw-r--r-- | compiler/rustc_passes/src/layout_test.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_passes/src/layout_test.rs b/compiler/rustc_passes/src/layout_test.rs index c1085094962..5322baee747 100644 --- a/compiler/rustc_passes/src/layout_test.rs +++ b/compiler/rustc_passes/src/layout_test.rs @@ -15,11 +15,11 @@ pub fn test_layout(tcx: TyCtxt<'_>) { // if the `rustc_attrs` feature is not enabled, don't bother testing layout for id in tcx.hir().items() { if matches!( - tcx.def_kind(id.def_id), + tcx.def_kind(id.owner_id), DefKind::TyAlias | DefKind::Enum | DefKind::Struct | DefKind::Union ) { - for attr in tcx.get_attrs(id.def_id.to_def_id(), sym::rustc_layout) { - dump_layout_of(tcx, id.def_id.def_id, attr); + for attr in tcx.get_attrs(id.owner_id.to_def_id(), sym::rustc_layout) { + dump_layout_of(tcx, id.owner_id.def_id, attr); } } } |
