Skip to content

Commit 4537025

Browse files
Add comment about first element in CStore::metas.
1 parent b8b957d commit 4537025

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_metadata/cstore.rs

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ pub struct CStore {
9696
impl CStore {
9797
pub fn new(metadata_loader: Box<MetadataLoader + Sync>) -> CStore {
9898
CStore {
99+
// We add an empty entry for LOCAL_CRATE (which maps to zero) in
100+
// order to make array indices in `metas` match with the
101+
// corresponding `CrateNum`. This first entry will always remain
102+
// `None`.
99103
metas: RwLock::new(IndexVec::from_elem_n(None, 1)),
100104
extern_mod_crate_map: Lock::new(FxHashMap()),
101105
metadata_loader,

0 commit comments

Comments
 (0)