diff options
Diffstat (limited to 'compiler/rustc_span')
| -rw-r--r-- | compiler/rustc_span/src/def_id.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/def_id.rs b/compiler/rustc_span/src/def_id.rs index b24ede9c53a..70e9526f626 100644 --- a/compiler/rustc_span/src/def_id.rs +++ b/compiler/rustc_span/src/def_id.rs @@ -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 @@ impl<D: Decoder> Decodable<D> for LocalDefId { } } +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) |
