Closed
Description
Given the following code (playground link):
extern "C" unsafe fn test() {}
The current output is:
error: expected `{`, found keyword `unsafe`
--> src/lib.rs:1:12
|
1 | extern "C" unsafe fn test() {}
| ^^^^^^ expected `{`
error: could not compile `playground` due to previous error
Ideally the output should look like the one for inverting unsafe
and a visibility like pub
:
error: expected one of `extern` or `fn`, found keyword `pub`
--> src/main.rs:1:8
|
1 | unsafe pub fn test() {}
| -------^^^
| | |
| | expected one of `extern` or `fn`
| help: visibility `pub` must come before `unsafe`: `pub unsafe`
error: could not compile `playground` due to previous error
Meta rustc -V
:
rustc 1.55.0-nightly (74ef0c3e4 2021-07-16)