1 //! The implementation must behave well if const values of wrong types are
5 #![feature(adt_const_params)]
6 #![feature(generic_const_exprs)]
7 #![feature(transmutability)]
8 #![allow(dead_code, incomplete_features, non_camel_case_types)]
11 use std::mem::{Assume, BikeshedIntrinsicFrom};
13 pub fn is_transmutable<
17 const ASSUME_ALIGNMENT: bool,
18 const ASSUME_LIFETIMES: bool,
19 const ASSUME_SAFETY: bool,
20 const ASSUME_VALIDITY: bool,
23 Dst: BikeshedIntrinsicFrom<
26 { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
34 const fn from_options(
51 #[repr(C)] struct Src;
52 #[repr(C)] struct Dst;
53 assert::is_transmutable::<Src, Dst, Context, {0u8}, false, false, false>(); //~ ERROR mismatched types
54 assert::is_transmutable::<Src, Dst, Context, false, {0u8}, false, false>(); //~ ERROR mismatched types
55 assert::is_transmutable::<Src, Dst, Context, false, false, {0u8}, false>(); //~ ERROR mismatched types
56 assert::is_transmutable::<Src, Dst, Context, false, false, false, {0u8}>(); //~ ERROR mismatched types