@@ -97,7 +97,7 @@ mod tests;
97
97
pub struct VecDeque <
98
98
T ,
99
99
#[ unstable( feature = "allocator_api" , issue = "32838" ) ] A : Allocator = Global ,
100
- const COOP_PREFERRED : bool = { DEFAULT_COOP_PREFERRED ! ( ) } ,
100
+ const COOP_PREFERRED : bool = { DEFAULT_COOP_PREFERRED ! ( ) } ,
101
101
> where
102
102
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
103
103
{
@@ -570,7 +570,8 @@ where
570
570
#[ rustc_const_stable( feature = "const_vec_deque_new" , since = "CURRENT_RUSTC_VERSION" ) ]
571
571
#[ must_use]
572
572
pub const fn new ( ) -> VecDeque < T , Global , COOP_PREFERRED >
573
- where [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
573
+ where
574
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < Global > ( COOP_PREFERRED ) ] : ,
574
575
{
575
576
// FIXME: This should just be `VecDeque::new_in(Global)` once that hits stable.
576
577
VecDeque { head : 0 , len : 0 , buf : RawVec :: NEW }
@@ -2903,13 +2904,11 @@ where
2903
2904
}
2904
2905
2905
2906
#[ stable( feature = "vecdeque_vec_conversions" , since = "1.10.0" ) ]
2906
- impl < T , A : Allocator , const COOP_PREFERRED : bool , const OTHER_COOP_PREFERRED : bool > From < Vec < T , A , OTHER_COOP_PREFERRED > >
2907
- for VecDeque < T , A , COOP_PREFERRED >
2907
+ impl < T , A : Allocator , const COOP_PREFERRED : bool , const OTHER_COOP_PREFERRED : bool >
2908
+ From < Vec < T , A , OTHER_COOP_PREFERRED > > for VecDeque < T , A , COOP_PREFERRED >
2908
2909
where
2909
2910
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2910
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > (
2911
- OTHER_COOP_PREFERRED ,
2912
- ) ] : ,
2911
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( OTHER_COOP_PREFERRED ) ] : ,
2913
2912
{
2914
2913
/// Turn a [`Vec<T>`] into a [`VecDeque<T>`].
2915
2914
///
@@ -2920,16 +2919,19 @@ where
2920
2919
/// and to not re-allocate the `Vec`'s buffer or allocate
2921
2920
/// any additional memory.
2922
2921
#[ inline]
2923
- fn from ( other : Vec < T , A , OTHER_COOP_PREFERRED > ) -> Self
2924
- {
2922
+ fn from ( other : Vec < T , A , OTHER_COOP_PREFERRED > ) -> Self {
2925
2923
let ( ptr, len, cap, alloc) = other. into_raw_parts_with_alloc ( ) ;
2926
- Self { head : 0 , len, buf : unsafe { RawVec :: < T , A , COOP_PREFERRED > :: from_raw_parts_in ( ptr, cap, alloc) } }
2924
+ Self {
2925
+ head : 0 ,
2926
+ len,
2927
+ buf : unsafe { RawVec :: < T , A , COOP_PREFERRED > :: from_raw_parts_in ( ptr, cap, alloc) } ,
2928
+ }
2927
2929
}
2928
2930
}
2929
2931
2930
2932
#[ stable( feature = "vecdeque_vec_conversions" , since = "1.10.0" ) ]
2931
- impl < T , A : Allocator , const COOP_PREFERRED : bool , const VECDEQUE_COOP_PREFERRED : bool > From < VecDeque < T , A , VECDEQUE_COOP_PREFERRED > >
2932
- for Vec < T , A , COOP_PREFERRED >
2933
+ impl < T , A : Allocator , const COOP_PREFERRED : bool , const VECDEQUE_COOP_PREFERRED : bool >
2934
+ From < VecDeque < T , A , VECDEQUE_COOP_PREFERRED > > for Vec < T , A , COOP_PREFERRED >
2933
2935
where
2934
2936
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( COOP_PREFERRED ) ] : ,
2935
2937
[ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( VECDEQUE_COOP_PREFERRED ) ] : ,
@@ -2963,11 +2965,9 @@ where
2963
2965
/// assert_eq!(vec, [8, 9, 1, 2, 3, 4]);
2964
2966
/// assert_eq!(vec.as_ptr(), ptr);
2965
2967
/// ```
2966
- fn from (
2967
- mut other : VecDeque < T , A , VECDEQUE_COOP_PREFERRED > ,
2968
- ) -> Self
2968
+ fn from ( mut other : VecDeque < T , A , VECDEQUE_COOP_PREFERRED > ) -> Self
2969
2969
where
2970
- [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( VECDEQUE_COOP_PREFERRED ) ] : ,
2970
+ [ ( ) ; alloc:: co_alloc_metadata_num_slots_with_preference :: < A > ( VECDEQUE_COOP_PREFERRED ) ] : ,
2971
2971
{
2972
2972
other. make_contiguous ( ) ;
2973
2973
0 commit comments