-
Couldn't load subscription status.
- Fork 13.9k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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)
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.