rustc_hir/
diagnostic_items.rs

1use rustc_data_structures::fx::FxIndexMap;
2use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
3use rustc_span::Symbol;
4use rustc_span::def_id::DefIdMap;
5
6use crate::def_id::DefId;
7
8#[derive(Debug, Default)]
9pub struct DiagnosticItems {
10    pub id_to_name: DefIdMap<Symbol>,
11    pub name_to_id: FxIndexMap<Symbol, DefId>,
12}
13
14impl<CTX: crate::HashStableContext> HashStable<CTX> for DiagnosticItems {
15    #[inline]
16    fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
17        self.name_to_id.hash_stable(ctx, hasher);
18    }
19}