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

Safe Keyword undescriptive errors #133586

Open
ionicmc-rs opened this issue Nov 28, 2024 · 0 comments
Open

Safe Keyword undescriptive errors #133586

ionicmc-rs opened this issue Nov 28, 2024 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-confusing Diagnostics: Confusing error or lint that should be reworked. 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

@ionicmc-rs
Copy link

ionicmc-rs commented Nov 28, 2024

Code

safe unsafe extern {
   // Code is irrelevant
}
// And
unsafe safe extern {
   // Code is irrelevant
}

Current output

help: `unsafe` must come before `safe`: `unsafe safe`
# And
help: `safe` must come before `unsafe`: `safe unsafe`

Desired output

# Either an error about how safe isn't stabilized (if it isn't) or something more descriptive
the keyword `safe` is unstable
# ...

Rationale and extra context

the same happens with nightly releases

Other cases

// Nope

Rust Version

binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1

Anything else?

i was just messing around when i found out safe was a valid keyword, but then i got an infinite loop of reversing the order of safe and unsafe

@ionicmc-rs ionicmc-rs 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 28, 2024
@jieyouxu jieyouxu added D-confusing Diagnostics: Confusing error or lint that should be reworked. D-terse Diagnostics: An error or lint that doesn't give enough information about the problem at hand. labels Nov 29, 2024
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 D-confusing Diagnostics: Confusing error or lint that should be reworked. 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

No branches or pull requests

2 participants