-
-
Notifications
You must be signed in to change notification settings - Fork 15k
Tracking issue for documenting individual built-in inert attributes in the standard library using #[doc(attribute = "…")] #157604
Copy link
Copy link
Open
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-lang-docsRelevant to the lang-docs team.Relevant to the lang-docs team.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCE-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.T-lang-docsRelevant to the lang-docs team.Relevant to the lang-docs team.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Back in August 2025 we merged PR #142472 which added a mechanism for us to document built-in inert attributes in libcore/libstd in the form of a new internal attribute
#[doc(attribute = "…")]to be placed on dummy modules. So far though, 9 months later, we haven't actually started documenting any attributes.Important
Similar to the preexisting "keyword docs" in the std library, these proposed "built-in attribute docs" are not meant to "replace" or "compete" with the Rust Reference!
Instead, they're merely meant to represent a guide-level explanation, not a reference-level one. They're to be written in more beginner-friendly language and they needn't exhaustively describe each attribute.
Finally, each "entry" ought to link to the relevant part of the Rust Reference if available using a relative filesystem path not a URL to allow for offline reading. Preferably at the bottom.
If there are any issues withRelevant to the rustdoc team, which will review and decide on the PR/issue.
or open a topic in the #t-rustdoc Zulip channel.
#[doc(attribute = "…")]itself, please create a new issue labeled T-rustdocAttributes to be documented:
allowclaimed by @kantnero: Add documentation forallowandcfgattributes. #158070automatically_derivedcfg_attrcfgclaimed by @kantnero: Add documentation forallowandcfgattributes. #158070cfi_encoding(unstable)coldcollapse_debuginfoconst_continue(unstable)coroutine(unstable)coveragecrate_namecrate_typedebugger_visualizerdenyclaimed by @kantnero:deprecateddiagnostic::do_not_recommenddiagnostic::on_const(unstable)diagnostic::on_move(unstable)diagnostic::on_type_error(unstable)diagnostic::on_unimplementeddiagnostic::on_unknown(unstable)diagnostic::on_unmatched_args(unstable)docexpectexport_name(unsafe (in Rust >=2024))export_stable(unstable)featureffi_const(unstable, unsafe)ffi_pure(unstable, unsafe)forbidclaimed by @kantnero:force_target_featurefundamental(unstable)ignoreinlineinstruction_setlink_namelink_ordinallink_section(unsafe (in Rust >=2024))linkloop_match(unstable)macro_escape(deprecated: usemacro_use)macro_exportmacro_usemarker(unstable)may_dangle(unstable)move_size_limitmust_not_suspend(unstable)must_useAdd documentation for themust_useattribute #157957naked(unsafe)no_builtinsno_core(unstable)no_implicit_preludeno_linkno_mainno_mangle(unsafe (in Rust >=2024))no_stdnon_exhaustiveoptimize(unstable)panic_handlerpatchable_function_entry(unstable)pathpin_v2(unstable)proc_macro_attributeproc_macro_deriveproc_macrorecursion_limitreexport_test_harness_main(unstable)register_tool(unstable)reprsanitizeshould_panicsplat(unstable)stable(unstable)target_featuretest_runner(unstable)thread_local(unstable)track_callertype_length_limitunstable(unstable)usedwarnwindows_subsystemThis list intentionally does not include internal attributes.
Disclaimer: This list may contain errors and might be missing some attributes.