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) }
30 const fn from_options(
47 #[repr(C)] struct Src;
48 #[repr(C)] struct Dst;
49 assert
::is_transmutable
::<Src
, Dst
, Context
, {0u8}
, false, false, false>(); //~ ERROR mismatched types
50 assert
::is_transmutable
::<Src
, Dst
, Context
, false, {0u8}
, false, false>(); //~ ERROR mismatched types
51 assert
::is_transmutable
::<Src
, Dst
, Context
, false, false, {0u8}
, false>(); //~ ERROR mismatched types
52 assert
::is_transmutable
::<Src
, Dst
, Context
, false, false, false, {0u8}
>(); //~ ERROR mismatched types