1
Fork 0

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:
Nicholas Nethercote 2025-02-02 19:51:37 +11:00
parent f89d509eb1
commit 6d03fa7519

View file

@ -329,9 +329,7 @@ impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for HirId {
}
}
macro_rules! impl_for_typed_def_id {
($Name:ident, $LocalName:ident) => {
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for $Name {
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for ModDefId {
#[inline(always)]
fn fingerprint_style() -> FingerprintStyle {
FingerprintStyle::DefPathHash
@ -349,11 +347,11 @@ macro_rules! impl_for_typed_def_id {
#[inline(always)]
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 {
impl<'tcx> DepNodeParams<TyCtxt<'tcx>> for LocalModDefId {
#[inline(always)]
fn fingerprint_style() -> FingerprintStyle {
FingerprintStyle::DefPathHash
@ -371,10 +369,6 @@ macro_rules! impl_for_typed_def_id {
#[inline(always)]
fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> {
LocalDefId::recover(tcx, dep_node).map($LocalName::new_unchecked)
LocalDefId::recover(tcx, dep_node).map(LocalModDefId::new_unchecked)
}
}
};
}
impl_for_typed_def_id! { ModDefId, LocalModDefId }