@@ -160,14 +160,12 @@ where
160
160
161
161
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
162
162
#[ allow( unused_braces) ]
163
- impl < T , const CO_ALLOC_PREF : CoAllocPref > Default for VecDeque < T , Global , CO_ALLOC_PREF >
164
- where
165
- [ ( ) ; { meta_num_slots_global ! ( CO_ALLOC_PREF ) } ] : ,
163
+ impl < T > Default for VecDeque < T >
166
164
{
167
165
/// Creates an empty deque.
168
166
#[ inline]
169
- fn default ( ) -> VecDeque < T , Global , CO_ALLOC_PREF > {
170
- VecDeque :: < T , Global , CO_ALLOC_PREF > :: new ( )
167
+ fn default ( ) -> VecDeque < T > {
168
+ VecDeque :: < T > :: new ( )
171
169
}
172
170
}
173
171
@@ -554,12 +552,7 @@ where
554
552
}
555
553
}
556
554
557
- #[ allow( unused_braces) ]
558
- impl < T , A : Allocator , const CO_ALLOC_PREF : CoAllocPref > VecDeque < T , A , CO_ALLOC_PREF >
559
- where
560
- [ ( ) ; { crate :: meta_num_slots!( A , CO_ALLOC_PREF ) } ] : ,
561
- [ ( ) ; { crate :: meta_num_slots_global!( CO_ALLOC_PREF ) } ] : ,
562
- {
555
+ impl < T > VecDeque < T > {
563
556
/// Creates an empty deque.
564
557
///
565
558
/// # Examples
@@ -573,14 +566,13 @@ where
573
566
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
574
567
#[ rustc_const_stable( feature = "const_vec_deque_new" , since = "1.68.0" ) ]
575
568
#[ must_use]
576
- pub const fn new ( ) -> VecDeque < T , Global , CO_ALLOC_PREF >
577
- where
578
- [ ( ) ; { crate :: meta_num_slots_global!( CO_ALLOC_PREF ) } ] : ,
569
+ #[ allow( unused_braces) ]
570
+ pub const fn new ( ) -> VecDeque < T , Global , { CO_ALLOC_PREF_DEFAULT ! ( ) } >
579
571
{
580
572
// FIXME: This should just be `VecDeque::new_in(Global)` once that hits stable.
581
573
VecDeque { head : 0 , len : 0 , buf : RawVec :: NEW }
582
574
}
583
-
575
+
584
576
/// Creates an empty deque with space for at least `capacity` elements.
585
577
///
586
578
/// # Examples
@@ -593,8 +585,9 @@ where
593
585
#[ inline]
594
586
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
595
587
#[ must_use]
596
- pub fn with_capacity ( capacity : usize ) -> VecDeque < T , Global , CO_ALLOC_PREF > {
597
- VecDeque :: < T , Global , CO_ALLOC_PREF > :: with_capacity_in ( capacity, Global )
588
+ #[ allow( unused_braces) ]
589
+ pub fn with_capacity ( capacity : usize ) -> VecDeque < T , Global , { CO_ALLOC_PREF_DEFAULT ! ( ) } > {
590
+ VecDeque :: < T , Global , { CO_ALLOC_PREF_DEFAULT ! ( ) } > :: with_capacity_in ( capacity, Global )
598
591
}
599
592
}
600
593
@@ -3006,9 +2999,7 @@ where
3006
2999
3007
3000
#[ stable( feature = "std_collections_from_array" , since = "1.56.0" ) ]
3008
3001
#[ allow( unused_braces) ]
3009
- impl < T , const N : usize , const CO_ALLOC_PREF : CoAllocPref > From < [ T ; N ] > for VecDeque < T , Global , CO_ALLOC_PREF >
3010
- where
3011
- [ ( ) ; { meta_num_slots_global ! ( CO_ALLOC_PREF ) } ] : ,
3002
+ impl < T , const N : usize > From < [ T ; N ] > for VecDeque < T >
3012
3003
{
3013
3004
/// Converts a `[T; N]` into a `VecDeque<T>`.
3014
3005
///
@@ -3020,7 +3011,7 @@ where
3020
3011
/// assert_eq!(deq1, deq2);
3021
3012
/// ```
3022
3013
fn from ( arr : [ T ; N ] ) -> Self {
3023
- let mut deq = VecDeque :: < T , Global , CO_ALLOC_PREF > :: with_capacity ( N ) ;
3014
+ let mut deq = VecDeque :: < T > :: with_capacity ( N ) ;
3024
3015
let arr = ManuallyDrop :: new ( arr) ;
3025
3016
if !<T >:: IS_ZST {
3026
3017
// SAFETY: VecDeque::with_capacity ensures that there is enough capacity.
0 commit comments