@@ -77,6 +77,8 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
7777 /// assert_eq!(&array[..], &[1, 2]);
7878 /// assert_eq!(array.capacity(), 16);
7979 /// ```
80+ #[ inline]
81+ #[ track_caller]
8082 pub fn new ( ) -> ArrayVec < T , CAP > {
8183 assert_capacity_limit ! ( CAP ) ;
8284 unsafe {
@@ -172,6 +174,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
172174 ///
173175 /// assert_eq!(&array[..], &[1, 2]);
174176 /// ```
177+ #[ track_caller]
175178 pub fn push ( & mut self , element : T ) {
176179 ArrayVecImpl :: push ( self , element)
177180 }
@@ -277,6 +280,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
277280 /// assert_eq!(&array[..], &["y", "x"]);
278281 ///
279282 /// ```
283+ #[ track_caller]
280284 pub fn insert ( & mut self , index : usize , element : T ) {
281285 self . try_insert ( index, element) . unwrap ( )
282286 }
@@ -748,6 +752,7 @@ impl<T, const CAP: usize> DerefMut for ArrayVec<T, CAP> {
748752/// assert_eq!(array.capacity(), 3);
749753/// ```
750754impl < T , const CAP : usize > From < [ T ; CAP ] > for ArrayVec < T , CAP > {
755+ #[ track_caller]
751756 fn from ( array : [ T ; CAP ] ) -> Self {
752757 let array = ManuallyDrop :: new ( array) ;
753758 let mut vec = <ArrayVec < T , CAP > >:: new ( ) ;
@@ -1011,6 +1016,7 @@ impl<T, const CAP: usize> Extend<T> for ArrayVec<T, CAP> {
10111016 /// Extend the `ArrayVec` with an iterator.
10121017 ///
10131018 /// ***Panics*** if extending the vector exceeds its capacity.
1019+ #[ track_caller]
10141020 fn extend < I : IntoIterator < Item =T > > ( & mut self , iter : I ) {
10151021 unsafe {
10161022 self . extend_from_iter :: < _ , true > ( iter)
@@ -1020,6 +1026,7 @@ impl<T, const CAP: usize> Extend<T> for ArrayVec<T, CAP> {
10201026
10211027#[ inline( never) ]
10221028#[ cold]
1029+ #[ track_caller]
10231030fn extend_panic ( ) {
10241031 panic ! ( "ArrayVec: capacity exceeded in extend/from_iter" ) ;
10251032}
@@ -1031,6 +1038,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
10311038 ///
10321039 /// Unsafe because if CHECK is false, the length of the input is not checked.
10331040 /// The caller must ensure the length of the input fits in the capacity.
1041+ #[ track_caller]
10341042 pub ( crate ) unsafe fn extend_from_iter < I , const CHECK : bool > ( & mut self , iterable : I )
10351043 where I : IntoIterator < Item = T >
10361044 {
0 commit comments