2024-06-16 18:38:08 +00:00
|
|
|
//@ known-bug: rust-lang/rust#126377
|
|
|
|
|
|
|
|
#![feature(effects)]
|
|
|
|
#![feature(generic_const_exprs)]
|
|
|
|
|
|
|
|
mod assert {
|
2024-08-27 14:05:54 +00:00
|
|
|
use std::mem::{Assume, TransmuteFrom};
|
2024-06-16 18:38:08 +00:00
|
|
|
|
|
|
|
pub fn is_transmutable<
|
|
|
|
Src,
|
|
|
|
Dst,
|
|
|
|
const ASSUME_ALIGNMENT: bool,
|
|
|
|
const ASSUME_LIFETIMES: bool,
|
|
|
|
const ASSUME_SAFETY: bool,
|
|
|
|
const ASSUME_VALIDITY: bool,
|
|
|
|
>()
|
|
|
|
where
|
2024-08-27 14:05:54 +00:00
|
|
|
Dst: TransmuteFrom<
|
2024-06-16 18:38:08 +00:00
|
|
|
Src,
|
|
|
|
{ }
|
|
|
|
>,
|
|
|
|
{}
|
|
|
|
}
|
|
|
|
|
|
|
|
const fn from_options() -> Assume {
|
|
|
|
#[repr(C)] struct Src;
|
|
|
|
#[repr(C)] struct Dst;
|
|
|
|
assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>();
|
|
|
|
}
|