@@ -299,6 +299,7 @@ impl<K, V, S> IndexMap<K, V, S> {
299299 ///
300300 /// ***Panics*** if the starting point is greater than the end point or if
301301 /// the end point is greater than the length of the map.
302+ #[ track_caller]
302303 pub fn drain < R > ( & mut self , range : R ) -> Drain < ' _ , K , V >
303304 where
304305 R : RangeBounds < usize > ,
@@ -313,6 +314,7 @@ impl<K, V, S> IndexMap<K, V, S> {
313314 /// the elements `[0, at)` with its previous capacity unchanged.
314315 ///
315316 /// ***Panics*** if `at > len`.
317+ #[ track_caller]
316318 pub fn split_off ( & mut self , at : usize ) -> Self
317319 where
318320 S : Clone ,
@@ -493,6 +495,7 @@ where
493495 /// assert_eq!(map.get_index_of(&'+'), Some(27));
494496 /// assert_eq!(map.len(), 28);
495497 /// ```
498+ #[ track_caller]
496499 pub fn insert_before ( & mut self , mut index : usize , key : K , value : V ) -> ( usize , Option < V > ) {
497500 assert ! ( index <= self . len( ) , "index out of bounds" ) ;
498501 match self . entry ( key) {
@@ -571,6 +574,7 @@ where
571574 /// // This is an invalid index for moving an existing key!
572575 /// map.shift_insert(map.len(), 'a', ());
573576 /// ```
577+ #[ track_caller]
574578 pub fn shift_insert ( & mut self , index : usize , key : K , value : V ) -> Option < V > {
575579 let len = self . len ( ) ;
576580 match self . entry ( key) {
@@ -627,6 +631,7 @@ where
627631 /// assert!(map.into_iter().eq([(0, '_'), (1, 'A'), (5, 'E'), (3, 'C'), (2, 'B'), (4, 'D')]));
628632 /// assert_eq!(removed, &[(2, 'b'), (3, 'c')]);
629633 /// ```
634+ #[ track_caller]
630635 pub fn splice < R , I > ( & mut self , range : R , replace_with : I ) -> Splice < ' _ , I :: IntoIter , K , V , S >
631636 where
632637 R : RangeBounds < usize > ,
@@ -1278,6 +1283,7 @@ impl<K, V, S> IndexMap<K, V, S> {
12781283 /// ***Panics*** if `from` or `to` are out of bounds.
12791284 ///
12801285 /// Computes in **O(n)** time (average).
1286+ #[ track_caller]
12811287 pub fn move_index ( & mut self , from : usize , to : usize ) {
12821288 self . core . move_index ( from, to)
12831289 }
@@ -1287,6 +1293,7 @@ impl<K, V, S> IndexMap<K, V, S> {
12871293 /// ***Panics*** if `a` or `b` are out of bounds.
12881294 ///
12891295 /// Computes in **O(1)** time (average).
1296+ #[ track_caller]
12901297 pub fn swap_indices ( & mut self , a : usize , b : usize ) {
12911298 self . core . swap_indices ( a, b)
12921299 }
0 commit comments