@@ -2306,6 +2306,7 @@ impl<T> [T] {
2306
2306
/// assert_eq!(&bytes, b"Hello, Wello!");
2307
2307
/// ```
2308
2308
#[ stable( feature = "copy_within" , since = "1.37.0" ) ]
2309
+ #[ track_caller]
2309
2310
pub fn copy_within < R : ops:: RangeBounds < usize > > ( & mut self , src : R , dest : usize )
2310
2311
where
2311
2312
T : Copy ,
@@ -2721,18 +2722,21 @@ where
2721
2722
2722
2723
#[ inline( never) ]
2723
2724
#[ cold]
2725
+ #[ track_caller]
2724
2726
fn slice_index_len_fail ( index : usize , len : usize ) -> ! {
2725
2727
panic ! ( "index {} out of range for slice of length {}" , index, len) ;
2726
2728
}
2727
2729
2728
2730
#[ inline( never) ]
2729
2731
#[ cold]
2732
+ #[ track_caller]
2730
2733
fn slice_index_order_fail ( index : usize , end : usize ) -> ! {
2731
2734
panic ! ( "slice index starts at {} but ends at {}" , index, end) ;
2732
2735
}
2733
2736
2734
2737
#[ inline( never) ]
2735
2738
#[ cold]
2739
+ #[ track_caller]
2736
2740
fn slice_index_overflow_fail ( ) -> ! {
2737
2741
panic ! ( "attempted to index slice up to maximum usize" ) ;
2738
2742
}
@@ -2804,11 +2808,13 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
2804
2808
/// Returns a shared reference to the output at this location, panicking
2805
2809
/// if out of bounds.
2806
2810
#[ unstable( feature = "slice_index_methods" , issue = "none" ) ]
2811
+ #[ cfg_attr( not( bootstrap) , track_caller) ]
2807
2812
fn index ( self , slice : & T ) -> & Self :: Output ;
2808
2813
2809
2814
/// Returns a mutable reference to the output at this location, panicking
2810
2815
/// if out of bounds.
2811
2816
#[ unstable( feature = "slice_index_methods" , issue = "none" ) ]
2817
+ #[ cfg_attr( not( bootstrap) , track_caller) ]
2812
2818
fn index_mut ( self , slice : & mut T ) -> & mut Self :: Output ;
2813
2819
}
2814
2820
0 commit comments