Checked transmute example

I created just a simple checked_transmute like

// Safety: All bit patterns for this type are valid values.
// No invalid niches, no required padding patterns, no special discriminants.
pub unsafe trait AnyBitPattern: Copy {}
unsafe impl AnyBitPattern for u8 {}
unsafe impl AnyBitPattern for u16 {}
unsafe impl AnyBitPattern for u32 {}
unsafe impl AnyBitPattern for u64 {}
unsafe impl AnyBitPattern for usize {}

unsafe impl AnyBitPattern for i8 {}
unsafe impl AnyBitPattern for i16 {}
unsafe impl AnyBitPattern for i32 {}
unsafe impl AnyBitPattern for i64 {}
unsafe impl AnyBitPattern for isize {}

unsafe impl AnyBitPattern for f32 {}
unsafe impl AnyBitPattern for f64 {}

// Arrays compose if the element is AnyBitPattern
unsafe impl<T: AnyBitPattern, const N: usize> AnyBitPattern for [T; N] {}
unsafe impl AnyBitPattern for u128 {}
unsafe impl AnyBitPattern for i128 {}
#[repr(transparent)]
#[derive(Copy, Clone)]
pub struct WrapU32(pub u32);
unsafe impl AnyBitPattern for WrapU32 {}
pub fn transmute_checked<Src, Dst>(src: Src) -> Option<Dst>
where
    Src: Copy + Sized + AnyBitPattern,
    Dst: Copy + Sized + AnyBitPattern,
{
    if size_of::<Src>() != size_of::<Dst>() { return None; }
    if align_of::<Src>() != align_of::<Dst>() { return None; }

    Some(unsafe { *(&src as *const Src as *const Dst) })
}



This is not right. Option<u8> has 257 valid bit patterns, while its storage requires 2 bytes (65536 options in total).

I fixed the bug it thank's