mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
23ab1bda92
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
23 lines
484 B
Rust
23 lines
484 B
Rust
//@ check-pass
|
|
#![feature(transmutability)]
|
|
|
|
mod assert {
|
|
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
|
|
|
pub fn is_maybe_transmutable<Src, Dst>()
|
|
where
|
|
Dst: BikeshedIntrinsicFrom<Src, {
|
|
Assume {
|
|
alignment: false,
|
|
lifetimes: false,
|
|
safety: true,
|
|
validity: false,
|
|
}
|
|
}>
|
|
{}
|
|
}
|
|
|
|
fn main() {
|
|
assert::is_maybe_transmutable::<&'static [u16; 0], &'static [u8; 0]>();
|
|
}
|