linearize/impls/
infallible.rs
1use {crate::Linearize, core::convert::Infallible};
2
3unsafe impl Linearize for Infallible {
7 type Storage<T> = [T; Self::LENGTH];
8 type CopyStorage<T>
9 = [T; Self::LENGTH]
10 where
11 T: Copy;
12 const LENGTH: usize = 0;
13
14 #[inline]
15 fn linearize(&self) -> usize {
16 unsafe {
17 cold_unreachable!();
19 }
20 }
21
22 #[inline]
23 unsafe fn from_linear_unchecked(_linear: usize) -> Self
24 where
25 Self: Sized,
26 {
27 unsafe {
28 cold_unreachable!();
30 }
31 }
32}
33
34impl_assert!(Infallible, 0);