@@ -103,7 +103,6 @@ pub struct VecDeque<
103103
104104#[ stable( feature = "rust1" , since = "1.0.0" ) ]
105105impl < T : Clone , A : Allocator + Clone > Clone for VecDeque < T , A > {
106- #[ track_caller]
107106 fn clone ( & self ) -> Self {
108107 let mut deq = Self :: with_capacity_in ( self . len ( ) , self . allocator ( ) . clone ( ) ) ;
109108 deq. extend ( self . iter ( ) . cloned ( ) ) ;
@@ -114,7 +113,6 @@ impl<T: Clone, A: Allocator + Clone> Clone for VecDeque<T, A> {
114113 ///
115114 /// This method is preferred over simply assigning `source.clone()` to `self`,
116115 /// as it avoids reallocation if possible.
117- #[ track_caller]
118116 fn clone_from ( & mut self , source : & Self ) {
119117 self . clear ( ) ;
120118 self . extend ( source. iter ( ) . cloned ( ) ) ;
@@ -577,7 +575,6 @@ impl<T> VecDeque<T> {
577575 #[ inline]
578576 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
579577 #[ must_use]
580- #[ track_caller]
581578 pub fn with_capacity ( capacity : usize ) -> VecDeque < T > {
582579 Self :: with_capacity_in ( capacity, Global )
583580 }
@@ -633,7 +630,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
633630 /// let deque: VecDeque<u32> = VecDeque::with_capacity(10);
634631 /// ```
635632 #[ unstable( feature = "allocator_api" , issue = "32838" ) ]
636- #[ track_caller]
637633 pub fn with_capacity_in ( capacity : usize , alloc : A ) -> VecDeque < T , A > {
638634 VecDeque { head : 0 , len : 0 , buf : RawVec :: with_capacity_in ( capacity, alloc) }
639635 }
@@ -799,7 +795,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
799795 ///
800796 /// [`reserve`]: VecDeque::reserve
801797 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
802- #[ track_caller]
803798 pub fn reserve_exact ( & mut self , additional : usize ) {
804799 let new_cap = self . len . checked_add ( additional) . expect ( "capacity overflow" ) ;
805800 let old_cap = self . capacity ( ) ;
@@ -830,7 +825,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
830825 /// ```
831826 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
832827 #[ cfg_attr( not( test) , rustc_diagnostic_item = "vecdeque_reserve" ) ]
833- #[ track_caller]
834828 pub fn reserve ( & mut self , additional : usize ) {
835829 let new_cap = self . len . checked_add ( additional) . expect ( "capacity overflow" ) ;
836830 let old_cap = self . capacity ( ) ;
@@ -962,7 +956,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
962956 /// assert!(buf.capacity() >= 4);
963957 /// ```
964958 #[ stable( feature = "deque_extras_15" , since = "1.5.0" ) ]
965- #[ track_caller]
966959 pub fn shrink_to_fit ( & mut self ) {
967960 self . shrink_to ( 0 ) ;
968961 }
@@ -988,7 +981,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
988981 /// assert!(buf.capacity() >= 4);
989982 /// ```
990983 #[ stable( feature = "shrink_to" , since = "1.56.0" ) ]
991- #[ track_caller]
992984 pub fn shrink_to ( & mut self , min_capacity : usize ) {
993985 let target_cap = min_capacity. max ( self . len ) ;
994986
@@ -1891,7 +1883,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
18911883 /// assert_eq!(d.front(), Some(&2));
18921884 /// ```
18931885 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1894- #[ track_caller]
18951886 pub fn push_front ( & mut self , value : T ) {
18961887 let _ = self . push_front_mut ( value) ;
18971888 }
@@ -1910,7 +1901,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
19101901 /// assert_eq!(d.front(), Some(&7));
19111902 /// ```
19121903 #[ unstable( feature = "push_mut" , issue = "135974" ) ]
1913- #[ track_caller]
19141904 #[ must_use = "if you don't need a reference to the value, use `VecDeque::push_front` instead" ]
19151905 pub fn push_front_mut ( & mut self , value : T ) -> & mut T {
19161906 if self . is_full ( ) {
@@ -1937,7 +1927,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
19371927 /// ```
19381928 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
19391929 #[ rustc_confusables( "push" , "put" , "append" ) ]
1940- #[ track_caller]
19411930 pub fn push_back ( & mut self , value : T ) {
19421931 let _ = self . push_back_mut ( value) ;
19431932 }
@@ -1956,7 +1945,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
19561945 /// assert_eq!(d.back(), Some(&10));
19571946 /// ```
19581947 #[ unstable( feature = "push_mut" , issue = "135974" ) ]
1959- #[ track_caller]
19601948 #[ must_use = "if you don't need a reference to the value, use `VecDeque::push_back` instead" ]
19611949 pub fn push_back_mut ( & mut self , value : T ) -> & mut T {
19621950 if self . is_full ( ) {
@@ -2071,7 +2059,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
20712059 /// assert_eq!(vec_deque, &['a', 'd', 'b', 'c', 'e']);
20722060 /// ```
20732061 #[ stable( feature = "deque_extras_15" , since = "1.5.0" ) ]
2074- #[ track_caller]
20752062 pub fn insert ( & mut self , index : usize , value : T ) {
20762063 let _ = self . insert_mut ( index, value) ;
20772064 }
@@ -2099,7 +2086,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
20992086 /// assert_eq!(vec_deque, &[1, 12, 2, 3]);
21002087 /// ```
21012088 #[ unstable( feature = "push_mut" , issue = "135974" ) ]
2102- #[ track_caller]
21032089 #[ must_use = "if you don't need a reference to the value, use `VecDeque::insert` instead" ]
21042090 pub fn insert_mut ( & mut self , index : usize , value : T ) -> & mut T {
21052091 assert ! ( index <= self . len( ) , "index out of bounds" ) ;
@@ -2205,7 +2191,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
22052191 #[ inline]
22062192 #[ must_use = "use `.truncate()` if you don't need the other half" ]
22072193 #[ stable( feature = "split_off" , since = "1.4.0" ) ]
2208- #[ track_caller]
22092194 pub fn split_off ( & mut self , at : usize ) -> Self
22102195 where
22112196 A : Clone ,
@@ -2272,7 +2257,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
22722257 /// ```
22732258 #[ inline]
22742259 #[ stable( feature = "append" , since = "1.4.0" ) ]
2275- #[ track_caller]
22762260 pub fn append ( & mut self , other : & mut Self ) {
22772261 if T :: IS_ZST {
22782262 self . len = self . len . checked_add ( other. len ) . expect ( "capacity overflow" ) ;
@@ -2395,7 +2379,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
23952379 // be called in cold paths.
23962380 // This may panic or abort
23972381 #[ inline( never) ]
2398- #[ track_caller]
23992382 fn grow ( & mut self ) {
24002383 // Extend or possibly remove this assertion when valid use-cases for growing the
24012384 // buffer without it being full emerge
@@ -2434,7 +2417,6 @@ impl<T, A: Allocator> VecDeque<T, A> {
24342417 /// assert_eq!(buf, [5, 10, 101, 102, 103]);
24352418 /// ```
24362419 #[ stable( feature = "vec_resize_with" , since = "1.33.0" ) ]
2437- #[ track_caller]
24382420 pub fn resize_with ( & mut self , new_len : usize , generator : impl FnMut ( ) -> T ) {
24392421 let len = self . len ;
24402422
@@ -2981,7 +2963,6 @@ impl<T: Clone, A: Allocator> VecDeque<T, A> {
29812963 /// assert_eq!(buf, [5, 10, 20, 20, 20]);
29822964 /// ```
29832965 #[ stable( feature = "deque_extras" , since = "1.16.0" ) ]
2984- #[ track_caller]
29852966 pub fn resize ( & mut self , new_len : usize , value : T ) {
29862967 if new_len > self . len ( ) {
29872968 let extra = new_len - self . len ( ) ;
@@ -3101,7 +3082,6 @@ impl<T, A: Allocator> IndexMut<usize> for VecDeque<T, A> {
31013082
31023083#[ stable( feature = "rust1" , since = "1.0.0" ) ]
31033084impl < T > FromIterator < T > for VecDeque < T > {
3104- #[ track_caller]
31053085 fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> VecDeque < T > {
31063086 SpecFromIter :: spec_from_iter ( iter. into_iter ( ) )
31073087 }
@@ -3141,19 +3121,16 @@ impl<'a, T, A: Allocator> IntoIterator for &'a mut VecDeque<T, A> {
31413121
31423122#[ stable( feature = "rust1" , since = "1.0.0" ) ]
31433123impl < T , A : Allocator > Extend < T > for VecDeque < T , A > {
3144- #[ track_caller]
31453124 fn extend < I : IntoIterator < Item = T > > ( & mut self , iter : I ) {
31463125 <Self as SpecExtend < T , I :: IntoIter > >:: spec_extend ( self , iter. into_iter ( ) ) ;
31473126 }
31483127
31493128 #[ inline]
3150- #[ track_caller]
31513129 fn extend_one ( & mut self , elem : T ) {
31523130 self . push_back ( elem) ;
31533131 }
31543132
31553133 #[ inline]
3156- #[ track_caller]
31573134 fn extend_reserve ( & mut self , additional : usize ) {
31583135 self . reserve ( additional) ;
31593136 }
@@ -3169,19 +3146,16 @@ impl<T, A: Allocator> Extend<T> for VecDeque<T, A> {
31693146
31703147#[ stable( feature = "extend_ref" , since = "1.2.0" ) ]
31713148impl < ' a , T : ' a + Copy , A : Allocator > Extend < & ' a T > for VecDeque < T , A > {
3172- #[ track_caller]
31733149 fn extend < I : IntoIterator < Item = & ' a T > > ( & mut self , iter : I ) {
31743150 self . spec_extend ( iter. into_iter ( ) ) ;
31753151 }
31763152
31773153 #[ inline]
3178- #[ track_caller]
31793154 fn extend_one ( & mut self , & elem: & ' a T ) {
31803155 self . push_back ( elem) ;
31813156 }
31823157
31833158 #[ inline]
3184- #[ track_caller]
31853159 fn extend_reserve ( & mut self , additional : usize ) {
31863160 self . reserve ( additional) ;
31873161 }
@@ -3279,7 +3253,6 @@ impl<T, const N: usize> From<[T; N]> for VecDeque<T> {
32793253 /// let deq2: VecDeque<_> = [1, 2, 3, 4].into();
32803254 /// assert_eq!(deq1, deq2);
32813255 /// ```
3282- #[ track_caller]
32833256 fn from ( arr : [ T ; N ] ) -> Self {
32843257 let mut deq = VecDeque :: with_capacity ( N ) ;
32853258 let arr = ManuallyDrop :: new ( arr) ;
0 commit comments