Skip to content

Commit 52da886

Browse files
committed
rustc/infer: miscellaneous minor code improvements
1 parent 70eeb05 commit 52da886

File tree

2 files changed

+2
-4
lines changed
  • src/librustc/infer

2 files changed

+2
-4
lines changed

src/librustc/infer/error_reporting/mod.rs

Whitespace-only changes.

src/librustc/infer/lexical_region_resolve/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ impl<'cx, 'gcx, 'tcx> LexicalResolver<'cx, 'gcx, 'tcx> {
147147
fn construct_var_data(&self, tcx: TyCtxt<'_, '_, 'tcx>) -> LexicalRegionResolutions<'tcx> {
148148
LexicalRegionResolutions {
149149
error_region: tcx.types.re_static,
150-
values: (0..self.num_vars())
151-
.map(|_| VarValue::Value(tcx.types.re_empty))
152-
.collect(),
150+
values: IndexVec::from_elem_n(VarValue::Value(tcx.types.re_empty), self.num_vars())
153151
}
154152
}
155153

src/librustc/infer/region_constraints/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
443443
assert!(self.undo_log[snapshot.length] == OpenSnapshot);
444444

445445
if snapshot.length == 0 {
446-
self.undo_log.truncate(0);
446+
self.undo_log.clear();
447447
} else {
448448
(*self.undo_log)[snapshot.length] = CommitedSnapshot;
449449
}

0 commit comments

Comments
 (0)