mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
30 lines
632 B
Rust
30 lines
632 B
Rust
//@ known-bug: rust-lang/rust#126377
|
|
|
|
#![feature(effects)]
|
|
#![feature(generic_const_exprs)]
|
|
|
|
mod assert {
|
|
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
|
|
|
pub fn is_transmutable<
|
|
Src,
|
|
Dst,
|
|
const ASSUME_ALIGNMENT: bool,
|
|
const ASSUME_LIFETIMES: bool,
|
|
const ASSUME_SAFETY: bool,
|
|
const ASSUME_VALIDITY: bool,
|
|
>()
|
|
where
|
|
Dst: BikeshedIntrinsicFrom<
|
|
Src,
|
|
{ }
|
|
>,
|
|
{}
|
|
}
|
|
|
|
const fn from_options() -> Assume {
|
|
#[repr(C)] struct Src;
|
|
#[repr(C)] struct Dst;
|
|
assert::is_transmutable::<Src, Dst, {0u8}, false, false, false>();
|
|
}
|