mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
change redundant clear()
to assertion
This commit is contained in:
parent
a0245bb3cb
commit
6b92d45342
@ -138,11 +138,9 @@ impl<'tcx> InferCtxtInner<'tcx> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if self.undo_log.num_open_snapshots == 1 {
|
if self.undo_log.num_open_snapshots == 1 {
|
||||||
// The root snapshot. It's safe to clear the undo log because
|
// After the root snapshot the undo log should be empty.
|
||||||
// there's no snapshot further out that we might need to roll back
|
|
||||||
// to.
|
|
||||||
assert!(snapshot.undo_len == 0);
|
assert!(snapshot.undo_len == 0);
|
||||||
self.undo_log.logs.clear();
|
assert!(self.undo_log.logs.is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.undo_log.num_open_snapshots -= 1;
|
self.undo_log.num_open_snapshots -= 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user