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

Move naked function ABI check to its own lint #87772

Merged
merged 2 commits into from
Aug 8, 2021

Conversation

npmccallum
Copy link
Contributor

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

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
@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 4, 2021
@npmccallum
Copy link
Contributor Author

r? @Amanieu

@rust-highfive rust-highfive assigned Amanieu and unassigned jackh726 Aug 4, 2021
@npmccallum
Copy link
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.

@Amanieu
Copy link
Member

Amanieu commented Aug 4, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Aug 4, 2021

📌 Commit ba9afb5 has been approved by Amanieu

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 4, 2021
@bors
Copy link
Contributor

bors commented Aug 7, 2021

⌛ Testing commit ba9afb5 with merge 80967b8dab4952ae9a965ac455665ad3278e5332...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 7, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 7, 2021
@Amanieu
Copy link
Member

Amanieu commented Aug 7, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Aug 7, 2021

📌 Commit 4968537 has been approved by Amanieu

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2021
@bors
Copy link
Contributor

bors commented Aug 7, 2021

⌛ Testing commit 4968537 with merge 798446f...

@bors
Copy link
Contributor

bors commented Aug 8, 2021

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing 798446f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 8, 2021
@bors bors merged commit 798446f into rust-lang:master Aug 8, 2021
@rustbot rustbot added this to the 1.56.0 milestone Aug 8, 2021
@bors bors mentioned this pull request Aug 8, 2021
@bstrie bstrie added the A-naked Area: #[naked], prologue and epilogue-free, functions, https://git.io/vAzzS label Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-naked Area: #[naked], prologue and epilogue-free, functions, https://git.io/vAzzS merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants