File tree 1 file changed +20
-2
lines changed
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].
134
134
135
135
## Document primitives
136
136
137
+ This is for Rust compiler internal use only.
138
+
137
139
Since 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
+ ```
140
158
141
159
## Unstable command-line arguments
142
160
You can’t perform that action at this time.
0 commit comments