-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Move naked function ABI check to its own lint #87772
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
This check was previously categorized under the lint named `UNSUPPORTED_NAKED_FUNCTIONS`. That lint is future incompatible and will be turned into an error in a future release. However, as defined in the Constrained Naked Functions RFC, this check should only be a warning. This is because it is possible for a naked function to be implemented in such a way that it does not break even the undefined ABI. For example, a `jmp` to a `const`. Therefore, this patch defines a new lint named `UNDEFINED_NAKED_FUNCTION_ABI` which contains just this single check. Unlike `UNSUPPORTED_NAKED_FUNCTIONS`, `UNDEFINED_NAKED_FUNCTION_ABI` will not be converted to an error in the future. rust-lang/rfcs#2774 rust-lang/rfcs#2972
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
r? @Amanieu |
@Amanieu Another possible implementation of this is to move this check to a different, pre-existing lint. But I didn't see an obvious candidate. |
@bors r+ |
📌 Commit ba9afb5 has been approved by |
⌛ Testing commit ba9afb5 with merge 80967b8dab4952ae9a965ac455665ad3278e5332... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r+ |
📌 Commit 4968537 has been approved by |
☀️ Test successful - checks-actions |
This check was previously categorized under the lint named
UNSUPPORTED_NAKED_FUNCTIONS
. That lint is future incompatible and willbe turned into an error in a future release. However, as defined in the
Constrained Naked Functions RFC, this check should only be a warning.
This is because it is possible for a naked function to be implemented in
such a way that it does not break even the undefined ABI. For example, a
jmp
to aconst
.Therefore, this patch defines a new lint named
UNDEFINED_NAKED_FUNCTION_ABI
which contains just this single check.Unlike
UNSUPPORTED_NAKED_FUNCTIONS
,UNDEFINED_NAKED_FUNCTION_ABI
will not be converted to an error in the future.
rust-lang/rfcs#2774
rust-lang/rfcs#2972