mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-15 22:32:31 +00:00
16 lines
333 B
Rust
16 lines
333 B
Rust
//@ check-fail
|
|
|
|
#![feature(transmutability)]
|
|
mod assert {
|
|
use std::mem::{Assume, TransmuteFrom};
|
|
|
|
pub fn is_transmutable<Src, Dst>()
|
|
where
|
|
Dst: TransmuteFrom<Src, { Assume::SAFETY }>
|
|
{}
|
|
}
|
|
|
|
fn main() {
|
|
assert::is_transmutable::<&'static mut bool, &'static mut u8>() //~ ERROR cannot be safely transmuted
|
|
}
|