]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_hir/src/diagnostic_items.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / compiler / rustc_hir / src / diagnostic_items.rs
CommitLineData
c295e0f8
XL
1use crate::def_id::DefId;
2use rustc_data_structures::fx::FxHashMap;
3use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
4use rustc_span::Symbol;
5
6#[derive(Debug, Default)]
7pub struct DiagnosticItems {
8 pub id_to_name: FxHashMap<DefId, Symbol>,
9 pub name_to_id: FxHashMap<Symbol, DefId>,
10}
11
12impl<CTX: crate::HashStableContext> HashStable<CTX> for DiagnosticItems {
13 #[inline]
14 fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
15 self.name_to_id.hash_stable(ctx, hasher);
16 }
17}