Skip to content

Commit 65a5b08

Browse files
committed
fix the impl error in insert_all
1 parent 7e19015 commit 65a5b08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_index/src/interval.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ impl<I: Idx> IntervalSet<I> {
203203

204204
pub fn insert_all(&mut self) {
205205
self.clear();
206-
self.map.push((0, self.domain.try_into().unwrap()));
206+
if let Some(end) = self.domain.checked_sub(1) {
207+
self.map.push((0, end.try_into().unwrap()));
208+
}
207209
debug_assert!(self.check_invariants());
208210
}
209211

0 commit comments

Comments
 (0)