1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::{
    typeset::{tset, ComputeTypeSet, ExpandTypeSet},
    TypeLayout, TypeLayoutInfo, TypeStructure,
};

unsafe impl<T: TypeLayout, const N: usize> TypeLayout for [T; N] {
    type Inhabited = T::Inhabited;

    const TYPE_LAYOUT: TypeLayoutInfo<'static> = TypeLayoutInfo {
        name: ::core::any::type_name::<Self>(),
        size: ::core::mem::size_of::<Self>(),
        alignment: ::core::mem::align_of::<Self>(),
        structure: TypeStructure::Primitive,
    };
}

unsafe impl<T: ComputeTypeSet, const N: usize> ComputeTypeSet for [T; N] {
    type Output<R: ExpandTypeSet> = tset![T, .. @ R];
}