Skip to content

#[naked]: report incompatible attributes - #127853

Merged
bors merged 7 commits into
rust-lang:masterfrom
folkertdev:naked-function-error-messages
Jul 28, 2024
Merged

bors merged 7 commits into
rust-lang:masterfrom
folkertdev:naked-function-error-messages

Conversation

@folkertdev

@folkertdev folkertdev commented Jul 17, 2024 •

Copy link
Copy Markdown
Contributor

tracking issue: #90957

this is a re-implementation of #93809 by @bstrie which was closed 2 years ago due to inactivity.

This PR takes some of the final comments into account, specifically providing a little more context in error messages, and using an allow list to determine which attributes are compatible with #[naked].

Notable attributes that are incompatible with #[naked] are:

  • #[inline]
  • #[track_caller]
  • #[target_feature] (this is now allowed, see PR discussion)
  • #[test], #[ignore], #[should_panic]

These attributes just directly conflict with what #[naked] should do.

Naked functions are still important for systems programming, embedded, and operating systems, so I'd like to move them forward.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.