@@ -4,7 +4,7 @@ use super::{AllocError, Allocator, ConstAllocator};
4
4
5
5
/// `Vec` that can only be used in a constant context.
6
6
#[ doc( hidden) ]
7
- pub struct ComptimeVec < T : Destruct > {
7
+ pub struct ComptimeVec < T : ~ const Destruct > {
8
8
ptr : NonNull < T > ,
9
9
len : usize ,
10
10
capacity : usize ,
@@ -39,7 +39,7 @@ impl<T: ~const Destruct> const Drop for ComptimeVec<T> {
39
39
}
40
40
}
41
41
42
- impl < T > ComptimeVec < T > {
42
+ impl < T : ~ const Destruct > ComptimeVec < T > {
43
43
pub const fn new_in ( allocator : ConstAllocator ) -> Self {
44
44
Self :: with_capacity_in ( 0 , allocator)
45
45
}
@@ -114,7 +114,7 @@ impl<T> ComptimeVec<T> {
114
114
115
115
/// Return a `ComptimeVec` of the same `len` as `self` with function `f`
116
116
/// applied to each element in order.
117
- pub const fn map < F : ~const FnMut ( & T ) -> U + ~const Destruct , U > (
117
+ pub const fn map < F : ~const FnMut ( & T ) -> U + ~const Destruct , U : ~ const Destruct > (
118
118
& self ,
119
119
mut f : F ,
120
120
) -> ComptimeVec < U > {
@@ -165,15 +165,15 @@ impl<T> ComptimeVec<T> {
165
165
}
166
166
}
167
167
168
- impl < T > const ops:: Deref for ComptimeVec < T > {
168
+ impl < T : ~ const Destruct > const ops:: Deref for ComptimeVec < T > {
169
169
type Target = [ T ] ;
170
170
171
171
fn deref ( & self ) -> & Self :: Target {
172
172
self . as_slice ( )
173
173
}
174
174
}
175
175
176
- impl < T > const ops:: DerefMut for ComptimeVec < T > {
176
+ impl < T : ~ const Destruct > const ops:: DerefMut for ComptimeVec < T > {
177
177
fn deref_mut ( & mut self ) -> & mut Self :: Target {
178
178
self . as_mut_slice ( )
179
179
}
0 commit comments