Skip to content

Commit 33dd288

Browse files
committed
Add a test case for extern "C" unsafe to the ui tests
1 parent 6ef11b8 commit 33dd288

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ edition:2018
2+
3+
// There is an order to respect for keywords before a function:
4+
// `<visibility>, const, async, unsafe, extern, "<ABI>"`
5+
//
6+
// This test ensures the compiler is helpful about them being misplaced.
7+
// Visibilities are tested elsewhere.
8+
9+
extern "C" unsafe fn test() {}
10+
//~^ ERROR
11+
12+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected `{`, found keyword `unsafe`
2+
--> $DIR/wrong-unsafe-abi.rs:9:12
3+
|
4+
LL | extern "C" unsafe fn test() {}
5+
| ^^^^^^ expected `{`
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)