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_lint/src/traits.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_lint/src/traits.rs')
| -rw-r--r-- | compiler/rustc_lint/src/traits.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/traits.rs b/compiler/rustc_lint/src/traits.rs index a118dda8b40..f22f38aa2ce 100644 --- a/compiler/rustc_lint/src/traits.rs +++ b/compiler/rustc_lint/src/traits.rs @@ -89,7 +89,7 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints { fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) { use rustc_middle::ty::PredicateKind::*; - let predicates = cx.tcx.explicit_predicates_of(item.def_id); + let predicates = cx.tcx.explicit_predicates_of(item.owner_id); for &(predicate, span) in predicates.predicates { let Trait(trait_predicate) = predicate.kind().skip_binder() else { continue |
