Skip to content

Add documentation for the cold and track_caller attributes#158484

Open
valentynkit wants to merge 1 commit into
rust-lang:mainfrom
valentynkit:docs-cold-track-caller-attributes
Open

Add documentation for the cold and track_caller attributes#158484
valentynkit wants to merge 1 commit into
rust-lang:mainfrom
valentynkit:docs-cold-track-caller-attributes

Conversation

@valentynkit

@valentynkit valentynkit commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Adds cold and track_caller, the two code generation attributes left from my claim on the tracking issue.

Both stay guide-level, with one runnable example each. For track_caller I used a small assert-style helper, since the attribute mainly affects which line a panic points at. inline is already up in #158348.

Part of #157604

r? @GuillaumeGomez

Tested with ./x test library/std --doc --test-args attribute_docs.

Document the built-in `cold` and `track_caller` attributes in the standard
library using the `#[doc(attribute = "...")]` mechanism, following the
existing `must_use` and `inline` attribute documentation.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants