summary refs log tree commit diff
path: root/tests/ui/transmutability/primitives/bool-mut.rs
blob: 5f3f4f3a8c5b4f0dc9a0fe49a8bd12e024157e09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ 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
}