]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_span/src/def_id.rs
Auto merge of #81635 - michaelwoerister:structured_def_path_hash, r=pnkfelix
[rust.git] / compiler / rustc_span / src / def_id.rs
index bd8c95fd6617106515d7d36c6bb028a00057f83d..885f30ebb4e6390f122c6bc90302a12733a27bd5 100644 (file)
@@ -314,6 +314,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 {
@@ -355,6 +357,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)