mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
make some debug assertions in RangeObjectMap be full assertions
This commit is contained in:
@@ -117,11 +117,11 @@ pub fn insert_at_pos(&mut self, pos: Position, range: AllocRange, data: T) {
|
||||
self.v.insert(pos, Elem { range, data });
|
||||
// If we aren't the first element, then our start must be greater than the preivous element's end
|
||||
if pos > 0 {
|
||||
debug_assert!(self.v[pos - 1].range.end() <= range.start);
|
||||
assert!(self.v[pos - 1].range.end() <= range.start);
|
||||
}
|
||||
// If we aren't the last element, then our end must be smaller than next element's start
|
||||
if pos < self.v.len() - 1 {
|
||||
debug_assert!(range.end() <= self.v[pos + 1].range.start);
|
||||
assert!(range.end() <= self.v[pos + 1].range.start);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user