Skip to content

Commit 6b92d45

Browse files
committed
change redundant clear() to assertion
1 parent a0245bb commit 6b92d45

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_infer/src/infer/undo_log.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,9 @@ impl<'tcx> InferCtxtInner<'tcx> {
138138
}
139139

140140
if self.undo_log.num_open_snapshots == 1 {
141-
// The root snapshot. It's safe to clear the undo log because
142-
// there's no snapshot further out that we might need to roll back
143-
// to.
141+
// After the root snapshot the undo log should be empty.
144142
assert!(snapshot.undo_len == 0);
145-
self.undo_log.logs.clear();
143+
assert!(self.undo_log.logs.is_empty());
146144
}
147145

148146
self.undo_log.num_open_snapshots -= 1;

0 commit comments

Comments
 (0)