Skip to content

Commit 6755601

Browse files
Add documentation for doc(attribute = "...") attribute
1 parent cb38ced commit 6755601

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/doc/rustdoc/src/unstable-features.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,23 @@ To do so, the `#[doc(keyword = "...")]` attribute is used. Example:
211211
mod empty_mod {}
212212
```
213213

214+
### Document builtin attributes
215+
216+
This is for Rust compiler internal use only.
217+
218+
Rust builtin attributes are documented in the standard library (look for `repr` for example).
219+
220+
To do so, the `#[doc(attribute = "...")]` attribute is used. Example:
221+
222+
```rust
223+
#![feature(rustdoc_internals)]
224+
#![allow(internal_features)]
225+
226+
/// Some documentation about the attribute.
227+
#[doc(attribute = "repr")]
228+
mod empty_mod {}
229+
```
230+
214231
### Use the Rust logo as the crate logo
215232

216233
This is for official Rust project use only.

0 commit comments

Comments
 (0)