@@ -158,7 +158,7 @@ where
158
158
}
159
159
160
160
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
161
- impl < T , const COOP_PREFERRED : bool = true > Default for VecDeque < T , Global , COOP_PREFERRED > {
161
+ impl < T , A : Allocator , const COOP_PREFERRED : bool > Default for VecDeque < T , Global , COOP_PREFERRED > {
162
162
/// Creates an empty deque.
163
163
#[ inline]
164
164
fn default ( ) -> VecDeque < T , Global , COOP_PREFERRED > {
@@ -547,7 +547,7 @@ where
547
547
}
548
548
}
549
549
550
- impl < T , Global , const COOP_PREFERRED : bool > VecDeque < T , Global , COOP_PREFERRED >
550
+ impl < T , A : Allocator , const COOP_PREFERRED : bool > VecDeque < T , A , COOP_PREFERRED >
551
551
where
552
552
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
553
553
{
@@ -581,7 +581,7 @@ where
581
581
#[ inline]
582
582
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
583
583
#[ must_use]
584
- pub fn with_capacity ( capacity : usize ) -> VecDeque < T , Global , COOP_PREFERRED > {
584
+ pub fn with_capacity ( capacity : usize ) -> VecDeque < T , A , COOP_PREFERRED > {
585
585
Self :: with_capacity_in ( capacity, Global )
586
586
}
587
587
}
@@ -2789,7 +2789,7 @@ where
2789
2789
}
2790
2790
2791
2791
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2792
- impl < T , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , GlobalAlloc , COOP_PREFERRED >
2792
+ impl < T , A : Allocator , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , A , COOP_PREFERRED >
2793
2793
where
2794
2794
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2795
2795
{
@@ -2974,8 +2974,8 @@ where
2974
2974
}
2975
2975
2976
2976
#[ stable( feature = "std_collections_from_array" , since = "1.56.0" ) ]
2977
- impl < T , const N : usize , const COOP_PREFERRED : bool > From < [ T ; N ] >
2978
- for VecDeque < T , Global , COOP_PREFERRED >
2977
+ impl < T , const N : usize , A : Allocator = Global , const COOP_PREFERRED : bool = DEFAULT_COOP_PREFERRED >
2978
+ From < [ T ; N ] > for VecDeque < T , A , COOP_PREFERRED >
2979
2979
where
2980
2980
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2981
2981
{
@@ -2994,6 +2994,7 @@ where
2994
2994
if !<T >:: IS_ZST {
2995
2995
// SAFETY: VecDeque::with_capacity ensures that there is enough capacity.
2996
2996
unsafe {
2997
+ // @FIXME for COOP_PREFERRED:
2997
2998
ptr:: copy_nonoverlapping ( arr. as_ptr ( ) , deq. ptr ( ) , N ) ;
2998
2999
}
2999
3000
}
0 commit comments