Move naked function ABI check to its own lint#87772
Merged
bors merged 2 commits intorust-lang:masterfrom Aug 8, 2021
Merged
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
Contributor
|
r? @jackh726 (rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
Author
|
r? @Amanieu |
Contributor
Author
|
@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. |
15 tasks
Member
|
@bors r+ |
Collaborator
|
📌 Commit ba9afb5 has been approved by |
Collaborator
|
⌛ Testing commit ba9afb5 with merge 80967b8dab4952ae9a965ac455665ad3278e5332... |
This comment has been minimized.
This comment has been minimized.
Collaborator
|
💔 Test failed - checks-actions |
Member
|
@bors r+ |
Collaborator
|
📌 Commit 4968537 has been approved by |
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
jmpto aconst.Therefore, this patch defines a new lint named
UNDEFINED_NAKED_FUNCTION_ABIwhich contains just this single check.Unlike
UNSUPPORTED_NAKED_FUNCTIONS,UNDEFINED_NAKED_FUNCTION_ABIwill not be converted to an error in the future.
rust-lang/rfcs#2774
rust-lang/rfcs#2972