diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-06-13 21:04:07 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-28 18:24:58 +0200 |
| commit | 38e8963b148fef9fb9c4263cc49d448985bb9982 (patch) | |
| tree | 2b092f574c45b6eaafbdf8b6ce819667b37f92e2 | |
| parent | 75cbd05d19a7cfb0819f15a57f2561cd28a956a7 (diff) | |
| download | rust-38e8963b148fef9fb9c4263cc49d448985bb9982.tar.gz rust-38e8963b148fef9fb9c4263cc49d448985bb9982.zip | |
Add documentation for `doc(attribute = "...")` attribute
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index bb28e3abbf3..25c929a1dba 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -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. |
