2019-09-02 16:28:37 -05:00
|
|
|
// check-fail
|
|
|
|
|
2021-06-04 14:37:16 -05:00
|
|
|
#![feature(core_intrinsics, intrinsics)]
|
2019-09-02 16:28:37 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2021-04-20 19:00:00 -05:00
|
|
|
fn c() {
|
|
|
|
let _ = [
|
2021-06-04 14:37:16 -05:00
|
|
|
std::intrinsics::likely,
|
|
|
|
std::intrinsics::unlikely,
|
2021-04-20 19:00:00 -05:00
|
|
|
//~^ ERROR cannot coerce
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2019-09-02 16:28:37 -05:00
|
|
|
fn main() {}
|