@@ -103,7 +103,6 @@ pub struct VecDeque<
103
103
104
104
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
105
105
impl < T : Clone , A : Allocator + Clone > Clone for VecDeque < T , A > {
106
- #[ track_caller]
107
106
fn clone ( & self ) -> Self {
108
107
let mut deq = Self :: with_capacity_in ( self . len ( ) , self . allocator ( ) . clone ( ) ) ;
109
108
deq. extend ( self . iter ( ) . cloned ( ) ) ;
@@ -114,7 +113,6 @@ impl<T: Clone, A: Allocator + Clone> Clone for VecDeque<T, A> {
114
113
///
115
114
/// This method is preferred over simply assigning `source.clone()` to `self`,
116
115
/// as it avoids reallocation if possible.
117
- #[ track_caller]
118
116
fn clone_from ( & mut self , source : & Self ) {
119
117
self . clear ( ) ;
120
118
self . extend ( source. iter ( ) . cloned ( ) ) ;
@@ -577,7 +575,6 @@ impl<T> VecDeque<T> {
577
575
#[ inline]
578
576
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
579
577
#[ must_use]
580
- #[ track_caller]
581
578
pub fn with_capacity ( capacity : usize ) -> VecDeque < T > {
582
579
Self :: with_capacity_in ( capacity, Global )
583
580
}
@@ -633,7 +630,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
633
630
/// let deque: VecDeque<u32> = VecDeque::with_capacity(10);
634
631
/// ```
635
632
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
636
- #[ track_caller]
637
633
pub fn with_capacity_in ( capacity : usize , alloc : A ) -> VecDeque < T , A > {
638
634
VecDeque { head : 0 , len : 0 , buf : RawVec :: with_capacity_in ( capacity, alloc) }
639
635
}
@@ -799,7 +795,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
799
795
///
800
796
/// [`reserve`]: VecDeque::reserve
801
797
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
802
- #[ track_caller]
803
798
pub fn reserve_exact ( & mut self , additional : usize ) {
804
799
let new_cap = self . len . checked_add ( additional) . expect ( "capacity overflow" ) ;
805
800
let old_cap = self . capacity ( ) ;
@@ -830,7 +825,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
830
825
/// ```
831
826
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
832
827
#[ cfg_attr( not( test) , rustc_diagnostic_item = "vecdeque_reserve" ) ]
833
- #[ track_caller]
834
828
pub fn reserve ( & mut self , additional : usize ) {
835
829
let new_cap = self . len . checked_add ( additional) . expect ( "capacity overflow" ) ;
836
830
let old_cap = self . capacity ( ) ;
@@ -962,7 +956,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
962
956
/// assert!(buf.capacity() >= 4);
963
957
/// ```
964
958
#[ stable( feature = "deque_extras_15" , since = "1.5.0" ) ]
965
- #[ track_caller]
966
959
pub fn shrink_to_fit ( & mut self ) {
967
960
self . shrink_to ( 0 ) ;
968
961
}
@@ -988,7 +981,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
988
981
/// assert!(buf.capacity() >= 4);
989
982
/// ```
990
983
#[ stable( feature = "shrink_to" , since = "1.56.0" ) ]
991
- #[ track_caller]
992
984
pub fn shrink_to ( & mut self , min_capacity : usize ) {
993
985
let target_cap = min_capacity. max ( self . len ) ;
994
986
@@ -1891,7 +1883,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
1891
1883
/// assert_eq!(d.front(), Some(&2));
1892
1884
/// ```
1893
1885
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1894
- #[ track_caller]
1895
1886
pub fn push_front ( & mut self , value : T ) {
1896
1887
let _ = self . push_front_mut ( value) ;
1897
1888
}
@@ -1910,7 +1901,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
1910
1901
/// assert_eq!(d.front(), Some(&7));
1911
1902
/// ```
1912
1903
#[ unstable( feature = "push_mut" , issue = "135974" ) ]
1913
- #[ track_caller]
1914
1904
#[ must_use = "if you don't need a reference to the value, use `VecDeque::push_front` instead" ]
1915
1905
pub fn push_front_mut ( & mut self , value : T ) -> & mut T {
1916
1906
if self . is_full ( ) {
@@ -1937,7 +1927,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
1937
1927
/// ```
1938
1928
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1939
1929
#[ rustc_confusables( "push" , "put" , "append" ) ]
1940
- #[ track_caller]
1941
1930
pub fn push_back ( & mut self , value : T ) {
1942
1931
let _ = self . push_back_mut ( value) ;
1943
1932
}
@@ -1956,7 +1945,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
1956
1945
/// assert_eq!(d.back(), Some(&10));
1957
1946
/// ```
1958
1947
#[ unstable( feature = "push_mut" , issue = "135974" ) ]
1959
- #[ track_caller]
1960
1948
#[ must_use = "if you don't need a reference to the value, use `VecDeque::push_back` instead" ]
1961
1949
pub fn push_back_mut ( & mut self , value : T ) -> & mut T {
1962
1950
if self . is_full ( ) {
@@ -2071,7 +2059,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
2071
2059
/// assert_eq!(vec_deque, &['a', 'd', 'b', 'c', 'e']);
2072
2060
/// ```
2073
2061
#[ stable( feature = "deque_extras_15" , since = "1.5.0" ) ]
2074
- #[ track_caller]
2075
2062
pub fn insert ( & mut self , index : usize , value : T ) {
2076
2063
let _ = self . insert_mut ( index, value) ;
2077
2064
}
@@ -2099,7 +2086,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
2099
2086
/// assert_eq!(vec_deque, &[1, 12, 2, 3]);
2100
2087
/// ```
2101
2088
#[ unstable( feature = "push_mut" , issue = "135974" ) ]
2102
- #[ track_caller]
2103
2089
#[ must_use = "if you don't need a reference to the value, use `VecDeque::insert` instead" ]
2104
2090
pub fn insert_mut ( & mut self , index : usize , value : T ) -> & mut T {
2105
2091
assert ! ( index <= self . len( ) , "index out of bounds" ) ;
@@ -2205,7 +2191,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
2205
2191
#[ inline]
2206
2192
#[ must_use = "use `.truncate()` if you don't need the other half" ]
2207
2193
#[ stable( feature = "split_off" , since = "1.4.0" ) ]
2208
- #[ track_caller]
2209
2194
pub fn split_off ( & mut self , at : usize ) -> Self
2210
2195
where
2211
2196
A : Clone ,
@@ -2272,7 +2257,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
2272
2257
/// ```
2273
2258
#[ inline]
2274
2259
#[ stable( feature = "append" , since = "1.4.0" ) ]
2275
- #[ track_caller]
2276
2260
pub fn append ( & mut self , other : & mut Self ) {
2277
2261
if T :: IS_ZST {
2278
2262
self . len = self . len . checked_add ( other. len ) . expect ( "capacity overflow" ) ;
@@ -2395,7 +2379,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
2395
2379
// be called in cold paths.
2396
2380
// This may panic or abort
2397
2381
#[ inline( never) ]
2398
- #[ track_caller]
2399
2382
fn grow ( & mut self ) {
2400
2383
// Extend or possibly remove this assertion when valid use-cases for growing the
2401
2384
// buffer without it being full emerge
@@ -2434,7 +2417,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
2434
2417
/// assert_eq!(buf, [5, 10, 101, 102, 103]);
2435
2418
/// ```
2436
2419
#[ stable( feature = "vec_resize_with" , since = "1.33.0" ) ]
2437
- #[ track_caller]
2438
2420
pub fn resize_with ( & mut self , new_len : usize , generator : impl FnMut ( ) -> T ) {
2439
2421
let len = self . len ;
2440
2422
@@ -2981,7 +2963,6 @@ impl<T: Clone, A: Allocator> VecDeque<T, A> {
2981
2963
/// assert_eq!(buf, [5, 10, 20, 20, 20]);
2982
2964
/// ```
2983
2965
#[ stable( feature = "deque_extras" , since = "1.16.0" ) ]
2984
- #[ track_caller]
2985
2966
pub fn resize ( & mut self , new_len : usize , value : T ) {
2986
2967
if new_len > self . len ( ) {
2987
2968
let extra = new_len - self . len ( ) ;
@@ -3101,7 +3082,6 @@ impl<T, A: Allocator> IndexMut<usize> for VecDeque<T, A> {
3101
3082
3102
3083
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3103
3084
impl < T > FromIterator < T > for VecDeque < T > {
3104
- #[ track_caller]
3105
3085
fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> VecDeque < T > {
3106
3086
SpecFromIter :: spec_from_iter ( iter. into_iter ( ) )
3107
3087
}
@@ -3141,19 +3121,16 @@ impl<'a, T, A: Allocator> IntoIterator for &'a mut VecDeque<T, A> {
3141
3121
3142
3122
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3143
3123
impl < T , A : Allocator > Extend < T > for VecDeque < T , A > {
3144
- #[ track_caller]
3145
3124
fn extend < I : IntoIterator < Item = T > > ( & mut self , iter : I ) {
3146
3125
<Self as SpecExtend < T , I :: IntoIter > >:: spec_extend ( self , iter. into_iter ( ) ) ;
3147
3126
}
3148
3127
3149
3128
#[ inline]
3150
- #[ track_caller]
3151
3129
fn extend_one ( & mut self , elem : T ) {
3152
3130
self . push_back ( elem) ;
3153
3131
}
3154
3132
3155
3133
#[ inline]
3156
- #[ track_caller]
3157
3134
fn extend_reserve ( & mut self , additional : usize ) {
3158
3135
self . reserve ( additional) ;
3159
3136
}
@@ -3169,19 +3146,16 @@ impl<T, A: Allocator> Extend<T> for VecDeque<T, A> {
3169
3146
3170
3147
#[ stable( feature = "extend_ref" , since = "1.2.0" ) ]
3171
3148
impl < ' a , T : ' a + Copy , A : Allocator > Extend < & ' a T > for VecDeque < T , A > {
3172
- #[ track_caller]
3173
3149
fn extend < I : IntoIterator < Item = & ' a T > > ( & mut self , iter : I ) {
3174
3150
self . spec_extend ( iter. into_iter ( ) ) ;
3175
3151
}
3176
3152
3177
3153
#[ inline]
3178
- #[ track_caller]
3179
3154
fn extend_one ( & mut self , & elem: & ' a T ) {
3180
3155
self . push_back ( elem) ;
3181
3156
}
3182
3157
3183
3158
#[ inline]
3184
- #[ track_caller]
3185
3159
fn extend_reserve ( & mut self , additional : usize ) {
3186
3160
self . reserve ( additional) ;
3187
3161
}
@@ -3279,7 +3253,6 @@ impl<T, const N: usize> From<[T; N]> for VecDeque<T> {
3279
3253
/// let deq2: VecDeque<_> = [1, 2, 3, 4].into();
3280
3254
/// assert_eq!(deq1, deq2);
3281
3255
/// ```
3282
- #[ track_caller]
3283
3256
fn from ( arr : [ T ; N ] ) -> Self {
3284
3257
let mut deq = VecDeque :: with_capacity ( N ) ;
3285
3258
let arr = ManuallyDrop :: new ( arr) ;
0 commit comments