diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-01-30 17:47:51 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-15 19:32:10 +0100 |
| commit | cebbba081e4609099df3921de8a1422b7ea52599 (patch) | |
| tree | 96784e4ada9c7d62e8890ce8bac2d4f840eba6c4 /compiler/rustc_lint/src/traits.rs | |
| parent | bd3cd5dbed5f56fb44a14a20dd2113e3049d2565 (diff) | |
| download | rust-cebbba081e4609099df3921de8a1422b7ea52599.tar.gz rust-cebbba081e4609099df3921de8a1422b7ea52599.zip | |
Only store a LocalDefId in hir::Item.
Items are guaranteed to be HIR owner.
Diffstat (limited to 'compiler/rustc_lint/src/traits.rs')
| -rw-r--r-- | compiler/rustc_lint/src/traits.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/traits.rs b/compiler/rustc_lint/src/traits.rs index b031c1108c6..e632f29e672 100644 --- a/compiler/rustc_lint/src/traits.rs +++ b/compiler/rustc_lint/src/traits.rs @@ -47,8 +47,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 def_id = cx.tcx.hir().local_def_id(item.hir_id); - let predicates = cx.tcx.explicit_predicates_of(def_id); + let predicates = cx.tcx.explicit_predicates_of(item.def_id); for &(predicate, span) in predicates.predicates { let trait_predicate = match predicate.kind().skip_binder() { Trait(trait_predicate, _constness) => trait_predicate, |
