about summary refs log tree commit diff
path: root/compiler/rustc_index/src/interval.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_index/src/interval.rs')
-rw-r--r--compiler/rustc_index/src/interval.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_index/src/interval.rs b/compiler/rustc_index/src/interval.rs
index 69a7a69610e..e81e7e2bc44 100644
--- a/compiler/rustc_index/src/interval.rs
+++ b/compiler/rustc_index/src/interval.rs
@@ -146,8 +146,11 @@ impl<I: Idx> IntervalSet<I> {
         let point = point.index() as u32;
 
         if let Some((first_start, _)) = self.map.first_mut() {
-            assert!(point < *first_start);
-            if point + 1 == *first_start {
+            assert!(point <= *first_start);
+            if point == *first_start {
+                // The point is already present in the set.
+            } else if point + 1 == *first_start {
+                // Just extend the first range.
                 *first_start = point;
             } else {
                 self.map.insert(0, (point, point));