Skip to content

Commit 3d90b4d

Browse files
add headings to categorize the features
1 parent 067553d commit 3d90b4d

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ there as necessary.
99

1010
[Unstable Book]: ../unstable-book/
1111

12-
## Error numbers for `compile-fail` doctests
12+
## Nightly-gated functionality
13+
14+
These features just require a nightly build to operate. Unlike the other features on this page,
15+
these don't need to be "turned on" with a command-line flag or a `#![feature(...)]` attribute in
16+
your crate. This can give them some subtle fallback modes when used on a stable release, so be
17+
careful!
18+
19+
### Error numbers for `compile-fail` doctests
1320

1421
As detailed in [the chapter on documentation tests][doctest-attributes], you can add a
1522
`compile_fail` attribute to a doctest to state that the test should fail to compile. However, on
@@ -32,7 +39,7 @@ future.
3239
Attempting to use these error numbers on stable will result in the code sample being interpreted as
3340
plain text.
3441

35-
## Linking to items by type
42+
### Linking to items by type
3643

3744
As designed in [RFC 1946], Rustdoc can parse paths to items when you use them as links. To resolve
3845
these type names, it uses the items currently in-scope, either by declaration or by `use` statement.
@@ -77,7 +84,12 @@ information about what parts of the feature are available.
7784

7885
[43466]: https://github.com/rust-lang/rust/issues/43466
7986

80-
## Documenting platform-/feature-specific information
87+
## Extensions to the `#[doc]` attribute
88+
89+
These features operate by extending the `#[doc]` attribute, and thus can be caught by the compiler
90+
and enabled with a `#![feature(...)]` attribute in your crate.
91+
92+
### Documenting platform-/feature-specific information
8193

8294
Because of the way Rustdoc documents a crate, the documentation it creates is specific to the target
8395
rustc compiles for. Anything that's specific to any other target is dropped via `#[cfg]` attribute
@@ -129,7 +141,7 @@ a feature gate. For more information, see [its chapter in the Unstable Book][uns
129141
[unstable-doc-cfg]: ../unstable-book/language-features/doc-cfg.html
130142
[issue-doc-cfg]: https://github.com/rust-lang/rust/issues/43781
131143

132-
## Adding your trait to the "Important Traits" dialog
144+
### Adding your trait to the "Important Traits" dialog
133145

134146
Rustdoc keeps a list of a few traits that are believed to be "fundamental" to a given type when
135147
implemented on it. These traits are intended to be the primary interface for their types, and are
@@ -149,7 +161,7 @@ chapter in the Unstable Book][unstable-spotlight] and [its tracking issue][issue
149161
[unstable-spotlight]: ../unstable-book/language-features/doc-spotlight.html
150162
[issue-spotlight]: https://github.com/rust-lang/rust/issues/45040
151163

152-
## Exclude certain dependencies from documentation
164+
### Exclude certain dependencies from documentation
153165

154166
The standard library uses several dependencies which, in turn, use several types and traits from the
155167
standard library. In addition, there are several compiler-internal crates that are not considered to
@@ -169,7 +181,7 @@ tracking issue][issue-masked].
169181
[unstable-masked]: ../unstable-book/language-features/doc-masked.html
170182
[issue-masked]: https://github.com/rust-lang/rust/issues/44027
171183

172-
## Include external files as API documentation
184+
### Include external files as API documentation
173185

174186
As designed in [RFC 1990], Rustdoc can read an external file to use as a type's documentation. This
175187
is useful if certain documentation is so long that it would break the flow of reading the source.

0 commit comments

Comments
 (0)