Skip to content

Commit a5cb9af

Browse files
committed
Change test to use likely/unlikely instead of copy/copy_overlapping.
Test was added in PR rust-lang#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`.
1 parent e118a2c commit a5cb9af

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/test/ui/reify-intrinsic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// check-fail
22

3-
#![feature(intrinsics)]
3+
#![feature(core_intrinsics, intrinsics)]
44

55
fn a() {
66
let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute;
@@ -14,8 +14,8 @@ fn b() {
1414

1515
fn c() {
1616
let _ = [
17-
std::intrinsics::copy_nonoverlapping::<i32>,
18-
std::intrinsics::copy::<i32>,
17+
std::intrinsics::likely,
18+
std::intrinsics::unlikely,
1919
//~^ ERROR cannot coerce
2020
];
2121
}

src/test/ui/reify-intrinsic.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ LL | let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize)
2222
error[E0308]: cannot coerce intrinsics to function pointers
2323
--> $DIR/reify-intrinsic.rs:18:9
2424
|
25-
LL | std::intrinsics::copy::<i32>,
26-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
25+
LL | std::intrinsics::unlikely,
26+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
2727
|
28-
= note: expected type `unsafe extern "rust-intrinsic" fn(_, _, _) {copy_nonoverlapping::<i32>}`
29-
found fn item `unsafe extern "rust-intrinsic" fn(_, _, _) {std::intrinsics::copy::<i32>}`
28+
= note: expected type `extern "rust-intrinsic" fn(_) -> _ {likely}`
29+
found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`
3030

3131
error: aborting due to 3 previous errors
3232

0 commit comments

Comments
 (0)