Only compute DefKind through the query.

This commit is contained in:
Camille GILLOT 2022-04-29 19:43:15 +02:00
parent 9a6fa4f118
commit e3d63203a3
3 changed files with 4 additions and 3 deletions

View file

@ -291,7 +291,7 @@ macro_rules! define_queries {
// accidentally triggering an infinite query loop.
let def_kind = key.key_as_def_id()
.and_then(|def_id| def_id.as_local())
.and_then(|def_id| tcx.hir().opt_def_kind(def_id));
.map(|def_id| tcx.def_kind(def_id));
let hash = || {
let mut hcx = tcx.create_stable_hashing_context();
let mut hasher = StableHasher::new();