Skip to content

Update naked to use the attribute template#1908

Merged
traviscross merged 8 commits into
rust-lang:masterfrom
ehuss:naked
May 31, 2026
Merged

Update naked to use the attribute template#1908
traviscross merged 8 commits into
rust-lang:masterfrom
ehuss:naked

Conversation

@ehuss
Copy link
Copy Markdown
Contributor

@ehuss ehuss commented Jun 30, 2025

New rules:

  • attributes.codegen.naked.syntax
  • attributes.codegen.naked.allowed-positions
  • attributes.codegen.naked.duplicates
  • attributes.codegen.naked.target_feature
  • attributes.codegen.naked.abi

Renamed rules:

  • attributes.codegen.naked.unsafe-attribute is now attributes.codegen.naked.unsafe

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
Comment thread src/attributes/codegen.md Outdated
- [Free functions][items.fn]
- [Inherent associated functions][items.associated.fn]
- [Trait impl functions][items.impl.trait]
- [Trait definition functions][items.traits] with a body
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work

Suggested change
- [Trait definition functions][items.traits] with a body
- [Trait][items.traits] [associated functions][items.associated.fn] with a body

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wording can be ambiguous, since it is unclear if it is an associated function in a trait definition or a trait impl. The original wording was specifically chosen to avoid that ambiguity and contrast with the previous item.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially wanted to link this to items.traits.associated-item-decls, due to being more specific, because items.traits was too general

  • [Trait definition functions][items.traits.associated-item-decls] with a body

is that alright

@tshepang
Copy link
Copy Markdown
Member

just 1 comment, otherwise this is good

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@ehuss
Copy link
Copy Markdown
Contributor Author

ehuss commented Feb 24, 2026

TODO: The error "patterns not allowed in naked function parameters" does not seem to be documented.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 31, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@traviscross
Copy link
Copy Markdown
Contributor

traviscross commented May 31, 2026

Thanks @ehuss.

cc rust-lang/rust#157201

@traviscross traviscross added this pull request to the merge queue May 31, 2026
Merged via the queue into rust-lang:master with commit 01b0ee7 May 31, 2026
6 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants