@@ -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
{
@@ -564,7 +564,7 @@ where
564
564
#[ inline]
565
565
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
566
566
#[ must_use]
567
- pub fn new ( ) -> VecDeque < T , Global , COOP_PREFERRED > {
567
+ pub fn new ( ) -> VecDeque < T , A , COOP_PREFERRED > {
568
568
VecDeque :: new_in ( Global )
569
569
}
570
570
@@ -580,7 +580,7 @@ where
580
580
#[ inline]
581
581
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
582
582
#[ must_use]
583
- pub fn with_capacity ( capacity : usize ) -> VecDeque < T , Global , COOP_PREFERRED > {
583
+ pub fn with_capacity ( capacity : usize ) -> VecDeque < T , A , COOP_PREFERRED > {
584
584
Self :: with_capacity_in ( capacity, Global )
585
585
}
586
586
}
@@ -2788,7 +2788,7 @@ where
2788
2788
}
2789
2789
2790
2790
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2791
- impl < T , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , GlobalAlloc , COOP_PREFERRED >
2791
+ impl < T , A : Allocator , const COOP_PREFERRED : bool > FromIterator < T > for VecDeque < T , A , COOP_PREFERRED >
2792
2792
where
2793
2793
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2794
2794
{
@@ -2973,8 +2973,8 @@ where
2973
2973
}
2974
2974
2975
2975
#[ stable( feature = "std_collections_from_array" , since = "1.56.0" ) ]
2976
- impl < T , const N : usize , const COOP_PREFERRED : bool > From < [ T ; N ] >
2977
- for VecDeque < T , Global , COOP_PREFERRED >
2976
+ impl < T , const N : usize , A : Allocator = Global , const COOP_PREFERRED : bool = DEFAULT_COOP_PREFERRED >
2977
+ From < [ T ; N ] > for VecDeque < T , A , COOP_PREFERRED >
2978
2978
where
2979
2979
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2980
2980
{
@@ -2993,6 +2993,7 @@ where
2993
2993
if !<T >:: IS_ZST {
2994
2994
// SAFETY: VecDeque::with_capacity ensures that there is enough capacity.
2995
2995
unsafe {
2996
+ // @FIXME for COOP_PREFERRED:
2996
2997
ptr:: copy_nonoverlapping ( arr. as_ptr ( ) , deq. ptr ( ) , N ) ;
2997
2998
}
2998
2999
}
0 commit comments