Skip to content

Commit f0e594c

Browse files
tests: Verify traits with unsupported ABIs must error
1 parent 05b223c commit f0e594c

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ compile-flags: --crate-type=lib
2+
3+
#![feature(abi_gpu_kernel)]
4+
5+
trait T {
6+
extern "gpu-kernel" fn mu();
7+
//~^ ERROR[E0570]
8+
}
9+
10+
type TAU = extern "gpu-kernel" fn();
11+
//~^ ERROR[E0570]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
2+
--> $DIR/unsupported-trait-decl.rs:6:12
3+
|
4+
LL | extern "gpu-kernel" fn mu();
5+
| ^^^^^^^^^^^^
6+
7+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
8+
--> $DIR/unsupported-trait-decl.rs:10:19
9+
|
10+
LL | type TAU = extern "gpu-kernel" fn();
11+
| ^^^^^^^^^^^^
12+
13+
error: aborting due to 2 previous errors
14+
15+
For more information about this error, try `rustc --explain E0570`.

0 commit comments

Comments
 (0)