Remove impl_for_typed_def_id
macro.
It has a single call site and removing it makes the code simpler. Perhaps there were more uses at some point in the past?
This commit is contained in:
parent
f89d509eb1
commit
6d03fa7519
1 changed files with 38 additions and 44 deletions
|
@ -329,52 +329,46 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for HirId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! impl_for_typed_def_id {
|
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for ModDefId {
|
||||||
($Name:ident, $LocalName:ident) => {
|
#[inline(always)]
|
||||||
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for $Name {
|
fn fingerprint_style() -> FingerprintStyle {
|
||||||
#[inline(always)]
|
FingerprintStyle::DefPathHash
|
||||||
fn fingerprint_style() -> FingerprintStyle {
|
}
|
||||||
FingerprintStyle::DefPathHash
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint {
|
fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint {
|
||||||
self.to_def_id().to_fingerprint(tcx)
|
self.to_def_id().to_fingerprint(tcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String {
|
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String {
|
||||||
self.to_def_id().to_debug_str(tcx)
|
self.to_def_id().to_debug_str(tcx)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> {
|
fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> {
|
||||||
DefId::recover(tcx, dep_node).map($Name::new_unchecked)
|
DefId::recover(tcx, dep_node).map(ModDefId::new_unchecked)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for $LocalName {
|
|
||||||
#[inline(always)]
|
|
||||||
fn fingerprint_style() -> FingerprintStyle {
|
|
||||||
FingerprintStyle::DefPathHash
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint {
|
|
||||||
self.to_def_id().to_fingerprint(tcx)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String {
|
|
||||||
self.to_def_id().to_debug_str(tcx)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
|
||||||
fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> {
|
|
||||||
LocalDefId::recover(tcx, dep_node).map($LocalName::new_unchecked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl_for_typed_def_id! { ModDefId, LocalModDefId }
|
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for LocalModDefId {
|
||||||
|
#[inline(always)]
|
||||||
|
fn fingerprint_style() -> FingerprintStyle {
|
||||||
|
FingerprintStyle::DefPathHash
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn to_fingerprint(&self, tcx: TyCtxt<'tcx>) -> Fingerprint {
|
||||||
|
self.to_def_id().to_fingerprint(tcx)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn to_debug_str(&self, tcx: TyCtxt<'tcx>) -> String {
|
||||||
|
self.to_def_id().to_debug_str(tcx)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> {
|
||||||
|
LocalDefId::recover(tcx, dep_node).map(LocalModDefId::new_unchecked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue