Add documentation for doc(attribute = "...") attribute

This commit is contained in:
Guillaume Gomez 2025-06-13 21:04:07 +02:00
parent 75cbd05d19
commit 38e8963b14

View file

@ -196,7 +196,7 @@ to enable.
### Document keywords
This is for Rust compiler internal use only.
This is for internal use in the std library.
Rust keywords are documented in the standard library (look for `match` for example).
@ -211,6 +211,23 @@ To do so, the `#[doc(keyword = "...")]` attribute is used. Example:
mod empty_mod {}
```
### Document builtin attributes
This is for internal use in the std library.
Rust builtin attributes are documented in the standard library (look for `repr` for example).
To do so, the `#[doc(attribute = "...")]` attribute is used. Example:
```rust
#![feature(rustdoc_internals)]
#![allow(internal_features)]
/// Some documentation about the attribute.
#[doc(attribute = "repr")]
mod empty_mod {}
```
### Use the Rust logo as the crate logo
This is for official Rust project use only.