@@ -77,6 +77,8 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
77
77
/// assert_eq!(&array[..], &[1, 2]);
78
78
/// assert_eq!(array.capacity(), 16);
79
79
/// ```
80
+ #[ inline]
81
+ #[ track_caller]
80
82
pub fn new ( ) -> ArrayVec < T , CAP > {
81
83
assert_capacity_limit ! ( CAP ) ;
82
84
unsafe {
@@ -172,6 +174,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
172
174
///
173
175
/// assert_eq!(&array[..], &[1, 2]);
174
176
/// ```
177
+ #[ track_caller]
175
178
pub fn push ( & mut self , element : T ) {
176
179
ArrayVecImpl :: push ( self , element)
177
180
}
@@ -277,6 +280,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
277
280
/// assert_eq!(&array[..], &["y", "x"]);
278
281
///
279
282
/// ```
283
+ #[ track_caller]
280
284
pub fn insert ( & mut self , index : usize , element : T ) {
281
285
self . try_insert ( index, element) . unwrap ( )
282
286
}
@@ -748,6 +752,7 @@ impl<T, const CAP: usize> DerefMut for ArrayVec<T, CAP> {
748
752
/// assert_eq!(array.capacity(), 3);
749
753
/// ```
750
754
impl < T , const CAP : usize > From < [ T ; CAP ] > for ArrayVec < T , CAP > {
755
+ #[ track_caller]
751
756
fn from ( array : [ T ; CAP ] ) -> Self {
752
757
let array = ManuallyDrop :: new ( array) ;
753
758
let mut vec = <ArrayVec < T , CAP > >:: new ( ) ;
@@ -1011,6 +1016,7 @@ impl<T, const CAP: usize> Extend<T> for ArrayVec<T, CAP> {
1011
1016
/// Extend the `ArrayVec` with an iterator.
1012
1017
///
1013
1018
/// ***Panics*** if extending the vector exceeds its capacity.
1019
+ #[ track_caller]
1014
1020
fn extend < I : IntoIterator < Item =T > > ( & mut self , iter : I ) {
1015
1021
unsafe {
1016
1022
self . extend_from_iter :: < _ , true > ( iter)
@@ -1020,6 +1026,7 @@ impl<T, const CAP: usize> Extend<T> for ArrayVec<T, CAP> {
1020
1026
1021
1027
#[ inline( never) ]
1022
1028
#[ cold]
1029
+ #[ track_caller]
1023
1030
fn extend_panic ( ) {
1024
1031
panic ! ( "ArrayVec: capacity exceeded in extend/from_iter" ) ;
1025
1032
}
@@ -1031,6 +1038,7 @@ impl<T, const CAP: usize> ArrayVec<T, CAP> {
1031
1038
///
1032
1039
/// Unsafe because if CHECK is false, the length of the input is not checked.
1033
1040
/// The caller must ensure the length of the input fits in the capacity.
1041
+ #[ track_caller]
1034
1042
pub ( crate ) unsafe fn extend_from_iter < I , const CHECK : bool > ( & mut self , iterable : I )
1035
1043
where I : IntoIterator < Item = T >
1036
1044
{
0 commit comments