@@ -153,10 +153,10 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
153
153
}
154
154
155
155
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
156
- impl < T > Default for VecDeque < T > {
156
+ impl < T , const COOP_PREFERRED : bool = true > Default for VecDeque < T , Global , COOP_PREFERRED > {
157
157
/// Creates an empty deque.
158
158
#[ inline]
159
- fn default ( ) -> VecDeque < T > {
159
+ fn default ( ) -> VecDeque < T , Global , COOP_PREFERRED > {
160
160
VecDeque :: new ( )
161
161
}
162
162
}
@@ -536,7 +536,8 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
536
536
}
537
537
}
538
538
539
- impl < T > VecDeque < T > {
539
+ impl < T , Global , const COOP_PREFERRED : bool > VecDeque < T , Global , COOP_PREFERRED >
540
+ where [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : {
540
541
/// Creates an empty deque.
541
542
///
542
543
/// # Examples
@@ -550,7 +551,7 @@ impl<T> VecDeque<T> {
550
551
#[ inline]
551
552
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
552
553
#[ must_use]
553
- pub fn new ( ) -> VecDeque < T > {
554
+ pub fn new ( ) -> VecDeque < T , Global , COOP_PREFERRED > {
554
555
VecDeque :: new_in ( Global )
555
556
}
556
557
@@ -566,7 +567,7 @@ impl<T> VecDeque<T> {
566
567
#[ inline]
567
568
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
568
569
#[ must_use]
569
- pub fn with_capacity ( capacity : usize ) -> VecDeque < T > {
570
+ pub fn with_capacity ( capacity : usize ) -> VecDeque < T , Global , COOP_PREFERRED > {
570
571
Self :: with_capacity_in ( capacity, Global )
571
572
}
572
573
}
@@ -584,7 +585,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
584
585
/// ```
585
586
#[ inline]
586
587
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
587
- pub const fn new_in ( alloc : A ) -> VecDeque < T , A > {
588
+ pub const fn new_in ( alloc : A ) -> VecDeque < T , A , COOP_PREFERRED > {
588
589
VecDeque { head : 0 , len : 0 , buf : RawVec :: new_in ( alloc) }
589
590
}
590
591
@@ -598,7 +599,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
598
599
/// let deque: VecDeque<u32> = VecDeque::with_capacity(10);
599
600
/// ```
600
601
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
601
- pub fn with_capacity_in ( capacity : usize , alloc : A ) -> VecDeque < T , A > {
602
+ pub fn with_capacity_in ( capacity : usize , alloc : A ) -> VecDeque < T , A , COOP_PREFERRED > {
602
603
VecDeque { head : 0 , len : 0 , buf : RawVec :: with_capacity_in ( capacity, alloc) }
603
604
}
604
605
@@ -2889,7 +2890,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
2889
2890
/// assert_eq!(vec, [8, 9, 1, 2, 3, 4]);
2890
2891
/// assert_eq!(vec.as_ptr(), ptr);
2891
2892
/// ```
2892
- fn from ( mut other : VecDeque < T , A > ) -> Self {
2893
+ fn from < const _VECDEQUE_COOP_PREFERRED : bool > ( mut other : VecDeque < T , A , _VECDEQUE_COOP_PREFERRED > ) -> Self {
2893
2894
other. make_contiguous ( ) ;
2894
2895
2895
2896
unsafe {
@@ -2902,6 +2903,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
2902
2903
if other. head != 0 {
2903
2904
ptr:: copy ( buf. add ( other. head ) , buf, len) ;
2904
2905
}
2906
+ // @TODO:
2905
2907
Vec :: from_raw_parts_in ( buf, len, cap, alloc)
2906
2908
}
2907
2909
}
0 commit comments