]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_span/src/def_id.rs
Rollup merge of #82645 - rkjnsn:patch-3, r=Mark-Simulacrum
[rust.git] / compiler / rustc_span / src / def_id.rs
index b24ede9c53aed1d431ff44aeb8bd68d77c912afd..70e9526f626da934f8ab49f237b5ad448d706785 100644 (file)
@@ -227,6 +227,8 @@ pub struct LocalDefId {
     pub local_def_index: DefIndex,
 }
 
+pub const CRATE_DEF_ID: LocalDefId = LocalDefId { local_def_index: CRATE_DEF_INDEX };
+
 impl Idx for LocalDefId {
     #[inline]
     fn new(idx: usize) -> Self {
@@ -268,6 +270,8 @@ fn decode(d: &mut D) -> Result<LocalDefId, D::Error> {
     }
 }
 
+rustc_data_structures::define_id_collections!(LocalDefIdMap, LocalDefIdSet, LocalDefId);
+
 impl<CTX: HashStableContext> HashStable<CTX> for DefId {
     fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
         hcx.hash_def_id(*self, hasher)