提交 15643d5d 编写于 作者: V Vadim Petrochenkov

Do not forget capacity when collecting def path hashes

上级 df57e286
......@@ -1863,14 +1863,13 @@ fn def_path_hash(&self, index: DefIndex) -> DefPathHash {
}
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();
for index in 0..self.num_def_ids() {
let index = DefIndex::from_usize(index);
let def_path_hash = self.def_path_hash_unlocked(index, &mut def_path_hashes);
result.push((def_path_hash, self.local_def_id(index)));
}
result
(0..self.num_def_ids())
.map(|index| {
let index = DefIndex::from_usize(index);
(self.def_path_hash_unlocked(index, &mut def_path_hashes), self.local_def_id(index))
})
.collect()
}
/// Get the `DepNodeIndex` corresponding this crate. The result of this
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册