From 2c8d5973f39c64a08b81483992928933a4f8fa02 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 2 Jun 2021 15:08:29 -0700 Subject: [PATCH] Add a hand-written error message for the `seek_internal` precondition --- zed/src/sum_tree/cursor.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zed/src/sum_tree/cursor.rs b/zed/src/sum_tree/cursor.rs index 5e1624aa87..649b3ad28a 100644 --- a/zed/src/sum_tree/cursor.rs +++ b/zed/src/sum_tree/cursor.rs @@ -413,7 +413,12 @@ where D: Dimension<'a, T::Summary>, { if let Some(target) = target { - debug_assert!(target.cmp(&self.seek_dimension, cx) >= Ordering::Equal); + debug_assert!( + target.cmp(&self.seek_dimension, cx) >= Ordering::Equal, + "cannot seek backward from {:?} to {:?}", + self.seek_dimension, + target + ); } if !self.did_seek {