1
Fork 0

rework implementation for inherent impls for builtin types

This commit is contained in:
lcnr 2022-03-15 16:30:30 +01:00
parent 4558a125b6
commit bef6f3e895
21 changed files with 364 additions and 413 deletions

View file

@ -141,6 +141,16 @@ impl Key for ty::WithOptConstParam<LocalDefId> {
}
}
impl Key for SimplifiedType {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {
true
}
fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}
impl Key for (DefId, DefId) {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {
@ -215,6 +225,16 @@ impl Key for (CrateNum, DefId) {
}
}
impl Key for (CrateNum, SimplifiedType) {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {
self.0 == LOCAL_CRATE
}
fn default_span(&self, _: TyCtxt<'_>) -> Span {
DUMMY_SP
}
}
impl Key for (DefId, SimplifiedType) {
#[inline(always)]
fn query_crate_is_local(&self) -> bool {