errors.clone()
} else {
errors
- .iter()
- .filter(|&e| !is_bound_failure(e))
- .cloned()
- .collect()
+ .iter()
+ .filter(|&e| !is_bound_failure(e))
+ .cloned()
+ .collect()
};
// sort the errors by span, for better error message stability.
fn construct_var_data(&self, tcx: TyCtxt<'_, '_, 'tcx>) -> LexicalRegionResolutions<'tcx> {
LexicalRegionResolutions {
error_region: tcx.types.re_static,
- values: (0..self.num_vars())
- .map(|_| VarValue::Value(tcx.types.re_empty))
- .collect(),
+ values: IndexVec::from_elem_n(VarValue::Value(tcx.types.re_empty), self.num_vars())
}
}
assert!(self.undo_log[snapshot.length] == OpenSnapshot);
if snapshot.length == 0 {
- self.undo_log.truncate(0);
+ self.undo_log.clear();
} else {
(*self.undo_log)[snapshot.length] = CommitedSnapshot;
}