@@ -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
}
@@ -2791,7 +2791,7 @@ where
2791
2791
}
2792
2792
2793
2793
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2794
- impl < T , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , GlobalAlloc , COOP_PREFERRED >
2794
+ impl < T , A : Allocator , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , A , COOP_PREFERRED >
2795
2795
where
2796
2796
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2797
2797
{
@@ -2976,8 +2976,8 @@ where
2976
2976
}
2977
2977
2978
2978
#[ stable( feature = "std_collections_from_array" , since = "1.56.0" ) ]
2979
- impl < T , const N : usize , const COOP_PREFERRED : bool > From < [ T ; N ] >
2980
- for VecDeque < T , Global , COOP_PREFERRED >
2979
+ impl < T , const N : usize , A : Allocator = Global , const COOP_PREFERRED : bool = DEFAULT_COOP_PREFERRED >
2980
+ From < [ T ; N ] > for VecDeque < T , A , COOP_PREFERRED >
2981
2981
where
2982
2982
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2983
2983
{
@@ -2996,6 +2996,7 @@ where
2996
2996
if !<T >:: IS_ZST {
2997
2997
// SAFETY: VecDeque::with_capacity ensures that there is enough capacity.
2998
2998
unsafe {
2999
+ // @FIXME for COOP_PREFERRED:
2999
3000
ptr:: copy_nonoverlapping ( arr. as_ptr ( ) , deq. ptr ( ) , N ) ;
3000
3001
}
3001
3002
}
0 commit comments