summaryrefslogtreecommitdiffstats
path: root/tests/ui/reify-intrinsic.rs
blob: 9eb2f724017ed40dd33c9441ce144673b6eeac72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// check-fail

#![feature(core_intrinsics, intrinsics)]

fn a() {
    let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
    //~^ ERROR cannot coerce
}

fn b() {
    let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize) -> usize;
    //~^ ERROR casting
}

fn c() {
    let _ = [
        std::intrinsics::likely,
        std::intrinsics::unlikely,
        //~^ ERROR cannot coerce
    ];
}

fn main() {}