Use def_key in tcx.item_name when possible.

This commit is contained in:
Camille GILLOT 2022-04-08 23:06:20 +02:00
parent b5dfa6a78d
commit f89d64d7aa
10 changed files with 41 additions and 42 deletions

View file

@ -517,10 +517,7 @@ rustc_queries! {
/// To avoid cycles within the predicates of a single item we compute
/// per-type-parameter predicates for resolving `T::AssocTy`.
query type_param_predicates(key: (DefId, LocalDefId, rustc_span::symbol::Ident)) -> ty::GenericPredicates<'tcx> {
desc { |tcx| "computing the bounds for type parameter `{}`", {
let id = tcx.hir().local_def_id_to_hir_id(key.1);
tcx.hir().ty_param_name(id)
}}
desc { |tcx| "computing the bounds for type parameter `{}`", tcx.hir().ty_param_name(key.1) }
}
query trait_def(key: DefId) -> ty::TraitDef {