23ab1bda92
Migrate to a simplified safety analysis that does not use visibility. Closes https://github.com/rust-lang/project-safe-transmute/issues/15
17 lines
388 B
Rust
17 lines
388 B
Rust
//@ check-fail
|
|
//@[next] compile-flags: -Znext-solver
|
|
|
|
#![feature(transmutability)]
|
|
mod assert {
|
|
use std::mem::{Assume, BikeshedIntrinsicFrom};
|
|
|
|
pub fn is_transmutable<Src, Dst>()
|
|
where
|
|
Dst: BikeshedIntrinsicFrom<Src, { Assume::SAFETY }>
|
|
{}
|
|
}
|
|
|
|
fn main() {
|
|
assert::is_transmutable::<&'static mut bool, &'static mut u8>() //~ ERROR cannot be safely transmuted
|
|
}
|