@@ -2306,6 +2306,7 @@ impl<T> [T] {
23062306 /// assert_eq!(&bytes, b"Hello, Wello!");
23072307 /// ```
23082308 #[ stable( feature = "copy_within" , since = "1.37.0" ) ]
2309+ #[ track_caller]
23092310 pub fn copy_within < R : ops:: RangeBounds < usize > > ( & mut self , src : R , dest : usize )
23102311 where
23112312 T : Copy ,
@@ -2721,18 +2722,21 @@ where
27212722
27222723#[ inline( never) ]
27232724#[ cold]
2725+ #[ track_caller]
27242726fn slice_index_len_fail ( index : usize , len : usize ) -> ! {
27252727 panic ! ( "index {} out of range for slice of length {}" , index, len) ;
27262728}
27272729
27282730#[ inline( never) ]
27292731#[ cold]
2732+ #[ track_caller]
27302733fn slice_index_order_fail ( index : usize , end : usize ) -> ! {
27312734 panic ! ( "slice index starts at {} but ends at {}" , index, end) ;
27322735}
27332736
27342737#[ inline( never) ]
27352738#[ cold]
2739+ #[ track_caller]
27362740fn slice_index_overflow_fail ( ) -> ! {
27372741 panic ! ( "attempted to index slice up to maximum usize" ) ;
27382742}
@@ -2804,11 +2808,13 @@ pub trait SliceIndex<T: ?Sized>: private_slice_index::Sealed {
28042808 /// Returns a shared reference to the output at this location, panicking
28052809 /// if out of bounds.
28062810 #[ unstable( feature = "slice_index_methods" , issue = "none" ) ]
2811+ #[ cfg_attr( not( bootstrap) , track_caller) ]
28072812 fn index ( self , slice : & T ) -> & Self :: Output ;
28082813
28092814 /// Returns a mutable reference to the output at this location, panicking
28102815 /// if out of bounds.
28112816 #[ unstable( feature = "slice_index_methods" , issue = "none" ) ]
2817+ #[ cfg_attr( not( bootstrap) , track_caller) ]
28122818 fn index_mut ( self , slice : & mut T ) -> & mut Self :: Output ;
28132819}
28142820
0 commit comments