@@ -98,7 +98,7 @@ pub struct VecDeque<
9898 #[ unstable( feature = "allocator_api" , issue = "32838" ) ] A : Allocator = Global ,
9999 const COOP_PREFERRED : bool = DEFAULT_COOP_PREFERRED ,
100100> where
101- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
101+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
102102{
103103 // `self[0]`, if it exists, is `buf[head]`.
104104 // `head < buf.capacity()`, unless `buf.capacity() == 0` when `head == 0`.
@@ -114,7 +114,7 @@ pub struct VecDeque<
114114impl < T : Clone , A : Allocator + Clone , const COOP_PREFERRED : bool > Clone
115115 for VecDeque < T , A , COOP_PREFERRED >
116116where
117- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
117+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
118118{
119119 fn clone ( & self ) -> Self {
120120 let mut deq = Self :: with_capacity_in ( self . len ( ) , self . allocator ( ) . clone ( ) ) ;
@@ -132,7 +132,7 @@ where
132132unsafe impl < #[ may_dangle] T , A : Allocator , const COOP_PREFERRED : bool > Drop
133133 for VecDeque < T , A , COOP_PREFERRED >
134134where
135- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
135+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
136136{
137137 fn drop ( & mut self ) {
138138 /// Runs the destructor for all items in the slice when it gets dropped (normally or
@@ -168,7 +168,7 @@ impl<T, A: Allocator, const COOP_PREFERRED: bool> Default for VecDeque<T, A, COO
168168
169169impl < T , A : Allocator , const COOP_PREFERRED : bool > VecDeque < T , A , COOP_PREFERRED >
170170where
171- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
171+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
172172{
173173 /// Marginally more convenient
174174 #[ inline]
@@ -460,15 +460,15 @@ where
460460 ) -> usize {
461461 struct Guard < ' a , T , A : Allocator , const COOP_PREFERRED : bool >
462462 where
463- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
463+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
464464 {
465465 deque : & ' a mut VecDeque < T , A , COOP_PREFERRED > ,
466466 written : usize ,
467467 }
468468
469469 impl < ' a , T , A : Allocator , const COOP_PREFERRED : bool > Drop for Guard < ' a , T , A , COOP_PREFERRED >
470470 where
471- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
471+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
472472 {
473473 fn drop ( & mut self ) {
474474 self . deque . len += self . written ;
@@ -549,7 +549,7 @@ where
549549
550550impl < T , A : Allocator , const COOP_PREFERRED : bool > VecDeque < T , A , COOP_PREFERRED >
551551where
552- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
552+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
553553{
554554 /// Creates an empty deque.
555555 ///
@@ -588,7 +588,7 @@ where
588588
589589impl < T , A : Allocator , const COOP_PREFERRED : bool > VecDeque < T , A , COOP_PREFERRED >
590590where
591- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
591+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
592592{
593593 /// Creates an empty deque.
594594 ///
@@ -2624,7 +2624,7 @@ where
26242624
26252625impl < T : Clone , A : Allocator , const COOP_PREFERRED : bool > VecDeque < T , A , COOP_PREFERRED >
26262626where
2627- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2627+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
26282628{
26292629 /// Modifies the deque in-place so that `len()` is equal to new_len,
26302630 /// either by removing excess elements from the back or by appending clones of `value`
@@ -2673,7 +2673,7 @@ fn wrap_index(logical_index: usize, capacity: usize) -> usize {
26732673impl < T : PartialEq , A : Allocator , const COOP_PREFERRED : bool > PartialEq
26742674 for VecDeque < T , A , COOP_PREFERRED >
26752675where
2676- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2676+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
26772677{
26782678 fn eq ( & self , other : & Self ) -> bool {
26792679 if self . len != other. len ( ) {
@@ -2714,7 +2714,7 @@ where
27142714
27152715#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27162716impl < T : Eq , A : Allocator , const COOP_PREFERRED : bool > Eq for VecDeque < T , A , COOP_PREFERRED > where
2717- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] :
2717+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] :
27182718{
27192719}
27202720
@@ -2729,7 +2729,7 @@ __impl_slice_eq1! { [const N: usize] VecDeque<T, A, COOP_PREFERRED>, &mut [U; N]
27292729impl < T : PartialOrd , A : Allocator , const COOP_PREFERRED : bool > PartialOrd
27302730 for VecDeque < T , A , COOP_PREFERRED >
27312731where
2732- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2732+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
27332733{
27342734 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
27352735 self . iter ( ) . partial_cmp ( other. iter ( ) )
@@ -2739,7 +2739,7 @@ where
27392739#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27402740impl < T : Ord , A : Allocator , const COOP_PREFERRED : bool > Ord for VecDeque < T , A , COOP_PREFERRED >
27412741where
2742- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2742+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
27432743{
27442744 #[ inline]
27452745 fn cmp ( & self , other : & Self ) -> Ordering {
@@ -2750,7 +2750,7 @@ where
27502750#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27512751impl < T : Hash , A : Allocator , const COOP_PREFERRED : bool > Hash for VecDeque < T , A , COOP_PREFERRED >
27522752where
2753- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2753+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
27542754{
27552755 fn hash < H : Hasher > ( & self , state : & mut H ) {
27562756 state. write_length_prefix ( self . len ) ;
@@ -2767,7 +2767,7 @@ where
27672767#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27682768impl < T , A : Allocator , const COOP_PREFERRED : bool > Index < usize > for VecDeque < T , A , COOP_PREFERRED >
27692769where
2770- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2770+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
27712771{
27722772 type Output = T ;
27732773
@@ -2780,7 +2780,7 @@ where
27802780#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27812781impl < T , A : Allocator , const COOP_PREFERRED : bool > IndexMut < usize > for VecDeque < T , A , COOP_PREFERRED >
27822782where
2783- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2783+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
27842784{
27852785 #[ inline]
27862786 fn index_mut ( & mut self , index : usize ) -> & mut T {
@@ -2791,7 +2791,7 @@ where
27912791#[ stable( feature = "rust1" , since = "1.0.0" ) ]
27922792impl < T , A : Allocator , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , A , COOP_PREFERRED >
27932793where
2794- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2794+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
27952795{
27962796 fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> VecDeque < T , Global , COOP_PREFERRED > {
27972797 SpecFromIter :: spec_from_iter ( iter. into_iter ( ) )
@@ -2801,7 +2801,7 @@ where
28012801#[ stable( feature = "rust1" , since = "1.0.0" ) ]
28022802impl < T , A : Allocator , const COOP_PREFERRED : bool > IntoIterator for VecDeque < T , A , COOP_PREFERRED >
28032803where
2804- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2804+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
28052805{
28062806 type Item = T ;
28072807 type IntoIter = IntoIter < T , A > ;
@@ -2817,7 +2817,7 @@ where
28172817impl < ' a , T , A : Allocator , const COOP_PREFERRED : bool > IntoIterator
28182818 for & ' a VecDeque < T , A , COOP_PREFERRED >
28192819where
2820- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2820+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
28212821{
28222822 type Item = & ' a T ;
28232823 type IntoIter = Iter < ' a , T > ;
@@ -2831,7 +2831,7 @@ where
28312831impl < ' a , T , A : Allocator , const COOP_PREFERRED : bool > IntoIterator
28322832 for & ' a mut VecDeque < T , A , COOP_PREFERRED >
28332833where
2834- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2834+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
28352835{
28362836 type Item = & ' a mut T ;
28372837 type IntoIter = IterMut < ' a , T > ;
@@ -2844,7 +2844,7 @@ where
28442844#[ stable( feature = "rust1" , since = "1.0.0" ) ]
28452845impl < T , A : Allocator , const COOP_PREFERRED : bool > Extend < T > for VecDeque < T , A , COOP_PREFERRED >
28462846where
2847- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2847+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
28482848{
28492849 fn extend < I : IntoIterator < Item = T > > ( & mut self , iter : I ) {
28502850 <Self as SpecExtend < T , I :: IntoIter > >:: spec_extend ( self , iter. into_iter ( ) ) ;
@@ -2865,7 +2865,7 @@ where
28652865impl < ' a , T : ' a + Copy , A : Allocator , const COOP_PREFERRED : bool > Extend < & ' a T >
28662866 for VecDeque < T , A , COOP_PREFERRED >
28672867where
2868- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2868+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
28692869{
28702870 fn extend < I : IntoIterator < Item = & ' a T > > ( & mut self , iter : I ) {
28712871 self . spec_extend ( iter. into_iter ( ) ) ;
@@ -2886,7 +2886,7 @@ where
28862886impl < T : fmt:: Debug , A : Allocator , const COOP_PREFERRED : bool > fmt:: Debug
28872887 for VecDeque < T , A , COOP_PREFERRED >
28882888where
2889- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2889+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
28902890{
28912891 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
28922892 f. debug_list ( ) . entries ( self . iter ( ) ) . finish ( )
@@ -2897,7 +2897,7 @@ where
28972897impl < T , A : Allocator , const COOP_PREFERRED : bool > From < Vec < T , A , COOP_PREFERRED > >
28982898 for VecDeque < T , A , COOP_PREFERRED >
28992899where
2900- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2900+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
29012901{
29022902 /// Turn a [`Vec<T>`] into a [`VecDeque<T>`].
29032903 ///
@@ -2910,7 +2910,9 @@ where
29102910 #[ inline]
29112911 fn from < const OTHER_COOP_PREFERRED : bool > ( other : Vec < T , A , OTHER_COOP_PREFERRED > ) -> Self
29122912 where
2913- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( OTHER_COOP_PREFERRED ) ] : ,
2913+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > (
2914+ OTHER_COOP_PREFERRED ,
2915+ ) ] : ,
29142916 {
29152917 let ( ptr, len, cap, alloc) = other. into_raw_parts_with_alloc ( ) ;
29162918 Self { head : 0 , len, buf : unsafe { RawVec :: from_raw_parts_in ( ptr, cap, alloc) } }
@@ -2921,7 +2923,7 @@ where
29212923impl < T , A : Allocator , const COOP_PREFERRED : bool > From < VecDeque < T , A , COOP_PREFERRED > >
29222924 for Vec < T , A , COOP_PREFERRED >
29232925where
2924- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2926+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
29252927{
29262928 /// Turn a [`VecDeque<T>`] into a [`Vec<T>`].
29272929 ///
@@ -2977,7 +2979,7 @@ where
29772979impl < T , const N : usize , A : Allocator , const COOP_PREFERRED : bool > From < [ T ; N ] >
29782980 for VecDeque < T , A , COOP_PREFERRED >
29792981where
2980- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2982+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference_specific :: < A > ( COOP_PREFERRED ) ] : ,
29812983{
29822984 /// Converts a `[T; N]` into a `VecDeque<T>`.
29832985 ///
0 commit comments