rust/tests/ui/transmutability/alignment/align-pass.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
516 B
Rust
Raw Normal View History

2023-04-27 20:33:52 -05:00
// 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]>();
}