summaryrefslogtreecommitdiffstats
path: root/tests/ui/transmutability/primitives/bool-mut.rs
blob: 6ee168d1a718cf9fbacf69205482a81a59a4e781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// check-fail
//[next] compile-flags: -Znext-solver

#![feature(transmutability)]
mod assert {
    use std::mem::{Assume, BikeshedIntrinsicFrom};
    pub struct Context;

    pub fn is_transmutable<Src, Dst>()
    where
        Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
    {}
}

fn main() {
    assert::is_transmutable::<&'static mut bool, &'static mut u8>() //~ ERROR cannot be safely transmuted
}