@@ -4,7 +4,7 @@ use super::{AllocError, Allocator, ConstAllocator};
44
55/// `Vec` that can only be used in a constant context.
66#[ doc( hidden) ]
7- pub struct ComptimeVec < T : Destruct > {
7+ pub struct ComptimeVec < T : ~ const Destruct > {
88 ptr : NonNull < T > ,
99 len : usize ,
1010 capacity : usize ,
@@ -39,7 +39,7 @@ impl<T: ~const Destruct> const Drop for ComptimeVec<T> {
3939 }
4040}
4141
42- impl < T > ComptimeVec < T > {
42+ impl < T : ~ const Destruct > ComptimeVec < T > {
4343 pub const fn new_in ( allocator : ConstAllocator ) -> Self {
4444 Self :: with_capacity_in ( 0 , allocator)
4545 }
@@ -114,7 +114,7 @@ impl<T> ComptimeVec<T> {
114114
115115 /// Return a `ComptimeVec` of the same `len` as `self` with function `f`
116116 /// 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 > (
118118 & self ,
119119 mut f : F ,
120120 ) -> ComptimeVec < U > {
@@ -165,15 +165,15 @@ impl<T> ComptimeVec<T> {
165165 }
166166}
167167
168- impl < T > const ops:: Deref for ComptimeVec < T > {
168+ impl < T : ~ const Destruct > const ops:: Deref for ComptimeVec < T > {
169169 type Target = [ T ] ;
170170
171171 fn deref ( & self ) -> & Self :: Target {
172172 self . as_slice ( )
173173 }
174174}
175175
176- impl < T > const ops:: DerefMut for ComptimeVec < T > {
176+ impl < T : ~ const Destruct > const ops:: DerefMut for ComptimeVec < T > {
177177 fn deref_mut ( & mut self ) -> & mut Self :: Target {
178178 self . as_mut_slice ( )
179179 }
0 commit comments