rust/tests/ui/transmutability/alignment/align-pass.rs
2023-05-24 14:52:19 -07:00

24 lines
516 B
Rust

// check-pass
#![feature(transmutability)]
mod assert {
use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
Dst: BikeshedIntrinsicFrom<Src, Context, {
Assume {
alignment: false,
lifetimes: false,
safety: true,
validity: false,
}
}>
{}
}
fn main() {
assert::is_maybe_transmutable::<&'static [u16; 0], &'static [u8; 0]>();
}