|
1 | 1 | #![unstable(feature = "raw_vec_internals", reason = "unstable const warnings", issue = "none")]
|
2 | 2 |
|
3 | 3 | use crate::meta_num_slots_default;
|
| 4 | +use core::alloc::CoAllocMetaBase; |
4 | 5 | use core::alloc::{self, LayoutError, PtrAndMeta};
|
5 | 6 | use core::cmp;
|
6 | 7 | use core::intrinsics;
|
7 | 8 | use core::mem::{self, ManuallyDrop, MaybeUninit, SizedTypeProperties};
|
8 | 9 | use core::ops::Drop;
|
9 | 10 | use core::ptr::{self, NonNull, Unique};
|
10 | 11 | use core::slice;
|
11 |
| -use core::alloc::CoAllocMetaBase; |
12 | 12 |
|
13 | 13 | #[cfg(not(no_global_oom_handling))]
|
14 | 14 | use crate::alloc::handle_alloc_error;
|
@@ -53,8 +53,11 @@ enum AllocInit {
|
53 | 53 | /// `Box<[T]>`, since `capacity()` won't yield the length.
|
54 | 54 | #[allow(missing_debug_implementations)]
|
55 | 55 | #[allow(unused_braces)] //@FIXME remove #[allow(unused_braces)] once that false positive warning fix is included on stable
|
56 |
| -pub(crate) struct RawVec<T, A: Allocator = Global, const COOP_PREF: bool = { CO_ALLOC_PREF_DEFAULT!() }> |
57 |
| -where |
| 56 | +pub(crate) struct RawVec< |
| 57 | + T, |
| 58 | + A: Allocator = Global, |
| 59 | + const COOP_PREF: bool = { CO_ALLOC_PREF_DEFAULT!() }, |
| 60 | +> where |
58 | 61 | [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREF)]:,
|
59 | 62 | {
|
60 | 63 | ptr: Unique<T>,
|
@@ -121,7 +124,7 @@ impl<T, A: Allocator, const COOP_PREF: bool> RawVec<T, A, COOP_PREF>
|
121 | 124 | where
|
122 | 125 | [(); alloc::co_alloc_metadata_num_slots_with_preference::<A>(COOP_PREF)]:,
|
123 | 126 | {
|
124 |
| - const fn new_plain_metas() -> [A::CoAllocMeta; {meta_num_slots_default!(A)}] { |
| 127 | + const fn new_plain_metas() -> [A::CoAllocMeta; { meta_num_slots_default!(A) }] { |
125 | 128 | loop {}
|
126 | 129 | }
|
127 | 130 |
|
|
0 commit comments