This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,27 @@ Book][unstable-masked] and [its tracking issue][issue-masked].
134134
135135## Document primitives
136136
137+ This is for Rust compiler internal use only.
138+
137139Since primitive types are defined in the compiler, there's no place to attach documentation
138- attributes. The ` #[doc(primitive)] ` attribute is used by the standard library to provide a way to generate
139- documentation for primitive types, and requires ` #![feature(doc_primitive)] ` to enable.
140+ attributes. The ` #[doc(primitive)] ` attribute is used by the standard library to provide a way
141+ to generate documentation for primitive types, and requires ` #![feature(doc_primitive)] ` to enable.
142+
143+ ## Document keywords
144+
145+ This is for Rust compiler internal use only.
146+
147+ Rust keywords are documented in the standard library (look for ` match ` for example).
148+
149+ To do so, the ` #[doc(keyword = "...")] ` attribute is used. Example:
150+
151+ ``` rust
152+ #![feature(doc_keyword)]
153+
154+ /// Some documentation about the keyword.
155+ #[doc(keyword = " keyword" )]
156+ mod empty_mod {}
157+ ```
140158
141159## Unstable command-line arguments
142160
You can’t perform that action at this time.
0 commit comments