crates/gpui/src/arena.rs 🔗
@@ -116,6 +116,7 @@ impl<T: ?Sized> ArenaBox<T> {
}
}
+ #[track_caller]
fn validate(&self) {
assert!(
self.valid.get(),
João Marcos created
To get useful logs when reporting bugs involving offsets out of range
Release Notes:
- N/A
crates/gpui/src/arena.rs | 1 +
crates/multi_buffer/src/multi_buffer.rs | 1 +
2 files changed, 2 insertions(+)
@@ -116,6 +116,7 @@ impl<T: ?Sized> ArenaBox<T> {
}
}
+ #[track_caller]
fn validate(&self) {
assert!(
self.valid.get(),
@@ -7320,6 +7320,7 @@ impl ToOffset for Point {
}
impl ToOffset for usize {
+ #[track_caller]
fn to_offset<'a>(&self, snapshot: &MultiBufferSnapshot) -> usize {
assert!(*self <= snapshot.len(), "offset is out of range");
*self