Made ArrayVec::new and ArrayString::new const fns
Added utils module with a `MaybeUninit` helper type to construct `[MaybeUninit<T>; N]` Removed all uses of the "unstable-const-fn" feature, and documented it as being deprecated. Changed `assert_capacity_limit` macro to work in const contexts.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
use std::marker::PhantomData;
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
pub(crate) struct MakeMaybeUninit<T, const N: usize>(PhantomData<fn() -> T>);
|
||||
|
||||
impl<T, const N: usize> MakeMaybeUninit<T, N> {
|
||||
pub(crate) const VALUE: MaybeUninit<T> = MaybeUninit::uninit();
|
||||
|
||||
pub(crate) const ARRAY: [MaybeUninit<T>; N] = [Self::VALUE; N];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user