diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-11-01 03:33:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-01 03:33:08 +0100 |
| commit | 0b8d3b1854fc2343963b1f122e86d0e153e3dc39 (patch) | |
| tree | fd6d154906febfdec02eb2a32bec5d59359ac83b /src/doc/rustdoc | |
| parent | 3730485a24e95db1f77201c6173cd189f403d151 (diff) | |
| parent | 7bea8eafde0a9afec94af8fc14486069b81c3809 (diff) | |
| download | rust-0b8d3b1854fc2343963b1f122e86d0e153e3dc39.tar.gz rust-0b8d3b1854fc2343963b1f122e86d0e153e3dc39.zip | |
Rollup merge of #90398 - GuillaumeGomez:doc-keyword-doc, r=camelid
Document `doc(keyword)` unstable attribute r? `@camelid`
Diffstat (limited to 'src/doc/rustdoc')
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 51f365be922..b3b6422afab 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -134,9 +134,27 @@ Book][unstable-masked] and [its tracking issue][issue-masked]. ## Document primitives +This is for Rust compiler internal use only. + Since primitive types are defined in the compiler, there's no place to attach documentation -attributes. The `#[doc(primitive)]` attribute is used by the standard library to provide a way to generate -documentation for primitive types, and requires `#![feature(doc_primitive)]` to enable. +attributes. The `#[doc(primitive)]` attribute is used by the standard library to provide a way +to generate documentation for primitive types, and requires `#![feature(doc_primitive)]` to enable. + +## Document keywords + +This is for Rust compiler internal use only. + +Rust keywords are documented in the standard library (look for `match` for example). + +To do so, the `#[doc(keyword = "...")]` attribute is used. Example: + +```rust +#![feature(doc_keyword)] + +/// Some documentation about the keyword. +#[doc(keyword = "keyword")] +mod empty_mod {} +``` ## Unstable command-line arguments |
