]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.rs
7f0761e99386a3c43a8f4a5c477327f94fc0831f
[rust.git] / src / test / ui / parser / issues / issue-87217-keyword-order / wrong-unsafe.rs
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 unsafe fn test() {}
10 //~^ ERROR expected `fn`, found keyword `unsafe`
11 //~| NOTE expected `fn`
12 //~| HELP `unsafe` must come before `extern`
13 //~| SUGGESTION unsafe extern
14 //~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`