blob: cb3c1cdf46cb6d11a092f2ff4770d4248f63f5e3 [file] [log] [blame]
//@ check-pass
//! When safety is assumed, a transmutation should be accepted if the
//! destination type might carry a safety invariant.
#![crate_type = "lib"]
#![feature(transmutability)]
#![allow(dead_code)]
mod assert {
use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst>()
where
Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }>
{}
}
fn test() {
type Src = ();
#[repr(C)]
struct Dst;
assert::is_transmutable::<Src, Dst>();
}