-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-nakedArea: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzSArea: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzSC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The following code fails to compile due to attribute checks on naked functions being too strict.
#[rustfmt::skip]
#[unsafe(naked)]
extern "C" fn naked() {
core::arch::naked_asm!("");
}
error[E0736]: attribute incompatible with `#[unsafe(naked)]`
--> src/lib.rs:1:1
|
1 | #[rustfmt::skip]
| ^^^^^^^^^^^^^^^^ the `rustfmt::skip` attribute is incompatible with `#[unsafe(naked)]`
2 | #[unsafe(naked)]
| ---------------- function marked with `#[unsafe(naked)]` here
For more information about this error, try `rustc --explain E0736`.
error: could not compile `playground` (lib) due to 1 previous error
cc @folkertdev
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-nakedArea: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzSArea: `#[naked]`, prologue and epilogue-free, functions, https://git.io/vAzzSC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.