1
Fork 0

Use LocalDefId in ItemCtxt

This commit is contained in:
Michael Goulet 2023-03-13 19:06:41 +00:00
parent 2eb1c08e43
commit 979ef5981f
11 changed files with 110 additions and 112 deletions

View file

@ -316,12 +316,12 @@ impl Key for (DefId, Option<Ident>) {
}
}
impl Key for (DefId, LocalDefId, Ident) {
impl Key for (LocalDefId, LocalDefId, Ident) {
type CacheSelector = DefaultCacheSelector<Self>;
type LocalKey = (LocalDefId, LocalDefId, Ident);
type LocalKey = Self;
fn as_local_key(&self) -> Option<Self::LocalKey> {
Some((self.0.as_local()?, self.1, self.2))
Some(*self)
}
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {

View file

@ -639,7 +639,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> {
query type_param_predicates(key: (LocalDefId, LocalDefId, rustc_span::symbol::Ident)) -> ty::GenericPredicates<'tcx> {
desc { |tcx| "computing the bounds for type parameter `{}`", tcx.hir().ty_param_name(key.1) }
}