未验证 提交 b57ca9d9 编写于 作者: N Niko Matsakis 提交者: GitHub

change from `dirty_bit_vec` to `clean_bit_vec`

Otherwise the vector is initially out of sync
上级 44b66681
......@@ -467,12 +467,16 @@ fn propagate_constraints(&mut self, mir: &Mir<'tcx>) {
let mut inferred_values = self.liveness_constraints.clone();
let dependency_map = self.build_dependency_map();
// Constraints that may need to be repropagated (initially all):
let mut dirty_list: Vec<_> = (0..self.constraints.len()).collect();
let mut dirty_bit_vec = BitVector::new(dirty_list.len());
// Set to 0 for each constraint that is on the dirty list:
let mut clean_bit_vec = BitVector::new(dirty_list.len());
debug!("propagate_constraints: --------------------");
while let Some(constraint_idx) = dirty_list.pop() {
dirty_bit_vec.remove(constraint_idx);
clean_bit_vec.insert(constraint_idx);
let constraint = &self.constraints[constraint_idx];
debug!("propagate_constraints: constraint={:?}", constraint);
......@@ -495,7 +499,7 @@ fn propagate_constraints(&mut self, mir: &Mir<'tcx>) {
debug!("propagate_constraints: sup={:?}", constraint.sup);
for &dep_idx in dependency_map.get(&constraint.sup).unwrap_or(&vec![]) {
if dirty_bit_vec.insert(dep_idx) {
if clean_bit_vec.remove(dep_idx) {
dirty_list.push(dep_idx);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册