rust/src/test/ui/reify-intrinsic.rs
Felix S. Klock II a5cb9afad8 Change test to use likely/unlikely instead of copy/copy_overlapping.
Test was added in PR #84404.

The intent here is: The `copy`/`copy_overlapping` intrinsics are going through
some flip-flopping now of "are they intrinsics or not". We can achieve the same
effect that the test intended by using `likely`/`unlikely`.
2021-06-04 16:44:28 -04:00

24 lines
450 B
Rust

// 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() {}