@@ -9,7 +9,14 @@ there as necessary.
9
9
10
10
[ Unstable Book ] : ../unstable-book/
11
11
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
13
20
14
21
As detailed in [ the chapter on documentation tests] [ doctest-attributes ] , you can add a
15
22
` compile_fail ` attribute to a doctest to state that the test should fail to compile. However, on
@@ -32,7 +39,7 @@ future.
32
39
Attempting to use these error numbers on stable will result in the code sample being interpreted as
33
40
plain text.
34
41
35
- ## Linking to items by type
42
+ ### Linking to items by type
36
43
37
44
As designed in [ RFC 1946] , Rustdoc can parse paths to items when you use them as links. To resolve
38
45
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.
77
84
78
85
[ 43466 ] : https://github.com/rust-lang/rust/issues/43466
79
86
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
81
93
82
94
Because of the way Rustdoc documents a crate, the documentation it creates is specific to the target
83
95
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
129
141
[ unstable-doc-cfg ] : ../unstable-book/language-features/doc-cfg.html
130
142
[ issue-doc-cfg ] : https://github.com/rust-lang/rust/issues/43781
131
143
132
- ## Adding your trait to the "Important Traits" dialog
144
+ ### Adding your trait to the "Important Traits" dialog
133
145
134
146
Rustdoc keeps a list of a few traits that are believed to be "fundamental" to a given type when
135
147
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
149
161
[ unstable-spotlight ] : ../unstable-book/language-features/doc-spotlight.html
150
162
[ issue-spotlight ] : https://github.com/rust-lang/rust/issues/45040
151
163
152
- ## Exclude certain dependencies from documentation
164
+ ### Exclude certain dependencies from documentation
153
165
154
166
The standard library uses several dependencies which, in turn, use several types and traits from the
155
167
standard library. In addition, there are several compiler-internal crates that are not considered to
@@ -169,7 +181,7 @@ tracking issue][issue-masked].
169
181
[ unstable-masked ] : ../unstable-book/language-features/doc-masked.html
170
182
[ issue-masked ] : https://github.com/rust-lang/rust/issues/44027
171
183
172
- ## Include external files as API documentation
184
+ ### Include external files as API documentation
173
185
174
186
As designed in [ RFC 1990] , Rustdoc can read an external file to use as a type's documentation. This
175
187
is useful if certain documentation is so long that it would break the flow of reading the source.
0 commit comments