Skip to content

Commit 4be1f51

Browse files
tests: Adopt ABI transmute tests from crashtests
1 parent 5c04441 commit 4be1f51

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

tests/crashes/138738.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#![feature(abi_gpu_kernel)]
2+
// Check we error before unsupported ABIs reach codegen stages.
3+
4+
fn main() {
5+
let a = unsafe { core::mem::transmute::<usize, extern "gpu-kernel" fn(i32)>(4) }(2);
6+
//~^ ERROR E0570
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
2+
--> $DIR/unsupported-abi-transmute.rs:5:59
3+
|
4+
LL | let a = unsafe { core::mem::transmute::<usize, extern "gpu-kernel" fn(i32)>(4) }(2);
5+
| ^^^^^^^^^^^^
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0570`.

0 commit comments

Comments
 (0)