Do not forget capacity when collecting def path hashes
This commit is contained in:
parent
df57e28685
commit
15643d5d90
1 changed files with 6 additions and 7 deletions
|
@ -1863,14 +1863,13 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn all_def_path_hashes_and_def_ids(&self) -> Vec<(DefPathHash, DefId)> {
|
fn all_def_path_hashes_and_def_ids(&self) -> Vec<(DefPathHash, DefId)> {
|
||||||
let mut result = Vec::new();
|
|
||||||
let mut def_path_hashes = self.def_path_hash_cache.lock();
|
let mut def_path_hashes = self.def_path_hash_cache.lock();
|
||||||
for index in 0..self.num_def_ids() {
|
(0..self.num_def_ids())
|
||||||
|
.map(|index| {
|
||||||
let index = DefIndex::from_usize(index);
|
let index = DefIndex::from_usize(index);
|
||||||
let def_path_hash = self.def_path_hash_unlocked(index, &mut def_path_hashes);
|
(self.def_path_hash_unlocked(index, &mut def_path_hashes), self.local_def_id(index))
|
||||||
result.push((def_path_hash, self.local_def_id(index)));
|
})
|
||||||
}
|
.collect()
|
||||||
result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the `DepNodeIndex` corresponding this crate. The result of this
|
/// Get the `DepNodeIndex` corresponding this crate. The result of this
|
||||||
|
|
Loading…
Reference in a new issue