mirror of https://github.com/rust-lang/rust.git
Add a test case for `extern "C" unsafe` to the ui tests
This commit is contained in:
parent
6ef11b81c2
commit
33dd288ef1
|
@ -0,0 +1,12 @@
|
||||||
|
//@ edition:2018
|
||||||
|
|
||||||
|
// There is an order to respect for keywords before a function:
|
||||||
|
// `<visibility>, const, async, unsafe, extern, "<ABI>"`
|
||||||
|
//
|
||||||
|
// This test ensures the compiler is helpful about them being misplaced.
|
||||||
|
// Visibilities are tested elsewhere.
|
||||||
|
|
||||||
|
extern "C" unsafe fn test() {}
|
||||||
|
//~^ ERROR
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -0,0 +1,8 @@
|
||||||
|
error: expected `{`, found keyword `unsafe`
|
||||||
|
--> $DIR/wrong-unsafe-abi.rs:9:12
|
||||||
|
|
|
||||||
|
LL | extern "C" unsafe fn test() {}
|
||||||
|
| ^^^^^^ expected `{`
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
Loading…
Reference in New Issue