Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make copy/copy_nonoverlapping fn's again #86003

Merged
merged 8 commits into from
Jun 9, 2021
Prev Previous commit
Next Next commit
Change test to use likely/unlikely instead of copy/`copy_overla…
…pping`.

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`.
  • Loading branch information
pnkfelix committed Jun 4, 2021
commit a5cb9afad8dc2a6ffff312c3b7c373339070018d
6 changes: 3 additions & 3 deletions src/test/ui/reify-intrinsic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// check-fail

#![feature(intrinsics)]
#![feature(core_intrinsics, intrinsics)]

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

fn c() {
let _ = [
std::intrinsics::copy_nonoverlapping::<i32>,
std::intrinsics::copy::<i32>,
std::intrinsics::likely,
std::intrinsics::unlikely,
//~^ ERROR cannot coerce
];
}
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/reify-intrinsic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ LL | let _ = std::mem::transmute as unsafe extern "rust-intrinsic" fn(isize)
error[E0308]: cannot coerce intrinsics to function pointers
--> $DIR/reify-intrinsic.rs:18:9
|
LL | std::intrinsics::copy::<i32>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
LL | std::intrinsics::unlikely,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers
|
= note: expected type `unsafe extern "rust-intrinsic" fn(_, _, _) {copy_nonoverlapping::<i32>}`
found fn item `unsafe extern "rust-intrinsic" fn(_, _, _) {std::intrinsics::copy::<i32>}`
= note: expected type `extern "rust-intrinsic" fn(_) -> _ {likely}`
found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`

error: aborting due to 3 previous errors

Expand Down