rustc/infer: miscellaneous minor code improvements
This commit is contained in:
parent
70eeb05441
commit
52da88639e
3 changed files with 6 additions and 8 deletions
|
|
@ -406,10 +406,10 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
|
|||
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.
|
||||
|
|
|
|||
|
|
@ -147,9 +147,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
|
|||
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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -443,7 +443,7 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue