Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unsafe: Bad diagnostic message #90880

Closed
b-ncMN opened this issue Nov 13, 2021 · 1 comment · Fixed by #91133
Closed

unsafe: Bad diagnostic message #90880

b-ncMN opened this issue Nov 13, 2021 · 1 comment · Fixed by #91133
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@b-ncMN
Copy link
Contributor

b-ncMN commented Nov 13, 2021

Given the following code:

pub extern "C" unsafe fn test() {}

The current output is:

error: expected `{`, found keyword `unsafe`
  --> tests/syscalls.rs:14:16
   |
14 | pub extern "C" unsafe fn test() {}
   |                ^^^^^^ expected `{`

Ideally the output should look like:

error: wrongfully placed unsafe keyword
  --> tests/syscalls.rs:14:16
   |
14 | pub extern "C" unsafe fn test() {}
   |                ^^^^ "Move after access specifier"
@b-ncMN b-ncMN added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 13, 2021
@JohnTitor JohnTitor added A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. labels Nov 16, 2021
@terrarier2111
Copy link
Contributor

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants