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