@@ -898,6 +898,7 @@ impl<T> Slab<T> {
898898 /// slab.key_of(bad); // this will panic
899899 /// unreachable!();
900900 /// ```
901+ #[ cfg_attr( not( slab_no_track_caller) , track_caller) ]
901902 pub fn key_of ( & self , present_element : & T ) -> usize {
902903 let element_ptr = present_element as * const T as usize ;
903904 let base_ptr = self . entries . as_ptr ( ) as usize ;
@@ -1066,6 +1067,7 @@ impl<T> Slab<T> {
10661067 /// assert_eq!(slab.remove(hello), "hello");
10671068 /// assert!(!slab.contains(hello));
10681069 /// ```
1070+ #[ cfg_attr( not( slab_no_track_caller) , track_caller) ]
10691071 pub fn remove ( & mut self , key : usize ) -> T {
10701072 self . try_remove ( key) . expect ( "invalid key" )
10711073 }
@@ -1173,6 +1175,7 @@ impl<T> Slab<T> {
11731175impl < T > ops:: Index < usize > for Slab < T > {
11741176 type Output = T ;
11751177
1178+ #[ cfg_attr( not( slab_no_track_caller) , track_caller) ]
11761179 fn index ( & self , key : usize ) -> & T {
11771180 match self . entries . get ( key) {
11781181 Some ( & Entry :: Occupied ( ref v) ) => v,
@@ -1182,6 +1185,7 @@ impl<T> ops::Index<usize> for Slab<T> {
11821185}
11831186
11841187impl < T > ops:: IndexMut < usize > for Slab < T > {
1188+ #[ cfg_attr( not( slab_no_track_caller) , track_caller) ]
11851189 fn index_mut ( & mut self , key : usize ) -> & mut T {
11861190 match self . entries . get_mut ( key) {
11871191 Some ( & mut Entry :: Occupied ( ref mut v) ) => v,
0 commit comments