@@ -153,10 +153,10 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
153153}
154154
155155#[ 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 > {
157157 /// Creates an empty deque.
158158 #[ inline]
159- fn default ( ) -> VecDeque < T > {
159+ fn default ( ) -> VecDeque < T , Global , COOP_PREFERRED > {
160160 VecDeque :: new ( )
161161 }
162162}
@@ -536,7 +536,8 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
536536 }
537537}
538538
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 ) ] : {
540541 /// Creates an empty deque.
541542 ///
542543 /// # Examples
@@ -550,7 +551,7 @@ impl<T> VecDeque<T> {
550551 #[ inline]
551552 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
552553 #[ must_use]
553- pub fn new ( ) -> VecDeque < T > {
554+ pub fn new ( ) -> VecDeque < T , Global , COOP_PREFERRED > {
554555 VecDeque :: new_in ( Global )
555556 }
556557
@@ -566,7 +567,7 @@ impl<T> VecDeque<T> {
566567 #[ inline]
567568 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
568569 #[ must_use]
569- pub fn with_capacity ( capacity : usize ) -> VecDeque < T > {
570+ pub fn with_capacity ( capacity : usize ) -> VecDeque < T , Global , COOP_PREFERRED > {
570571 Self :: with_capacity_in ( capacity, Global )
571572 }
572573}
@@ -584,7 +585,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
584585 /// ```
585586 #[ inline]
586587 #[ 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 > {
588589 VecDeque { head : 0 , len : 0 , buf : RawVec :: new_in ( alloc) }
589590 }
590591
@@ -598,7 +599,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
598599 /// let deque: VecDeque<u32> = VecDeque::with_capacity(10);
599600 /// ```
600601 #[ 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 > {
602603 VecDeque { head : 0 , len : 0 , buf : RawVec :: with_capacity_in ( capacity, alloc) }
603604 }
604605
@@ -2889,7 +2890,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
28892890 /// assert_eq!(vec, [8, 9, 1, 2, 3, 4]);
28902891 /// assert_eq!(vec.as_ptr(), ptr);
28912892 /// ```
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 {
28932894 other. make_contiguous ( ) ;
28942895
28952896 unsafe {
@@ -2902,6 +2903,7 @@ where [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREFERRE
29022903 if other. head != 0 {
29032904 ptr:: copy ( buf. add ( other. head ) , buf, len) ;
29042905 }
2906+ // @TODO:
29052907 Vec :: from_raw_parts_in ( buf, len, cap, alloc)
29062908 }
29072909 }
0 commit comments