File tree 1 file changed +29
-0
lines changed
src/doc/rustdoc/src/write-documentation
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -170,3 +170,32 @@ There are a few attributes which are not inlined though:
170
170
171
171
All other attributes are inherited when inlined, so that the documentation matches the behavior if
172
172
the inlined item was directly defined at the spot where it's shown.
173
+
174
+ These rules also apply if the item is inlined with a glob re-export:
175
+
176
+ ``` rust,ignore (inline)
177
+ mod private_mod {
178
+ /// First
179
+ #[cfg(a)]
180
+ pub struct InPrivate;
181
+ }
182
+
183
+ #[cfg(c)]
184
+ pub use self::private_mod::*;
185
+ ```
186
+
187
+ Otherwise, the attributes displayed will be from the re-exported item and the attributes on the
188
+ re-export itself will be ignored:
189
+
190
+ ``` rust,ignore (inline)
191
+ mod private_mod {
192
+ /// First
193
+ #[cfg(a)]
194
+ pub struct InPrivate;
195
+ }
196
+
197
+ #[cfg(c)]
198
+ pub use self::private_mod::InPrivate;
199
+ ```
200
+
201
+ In the above case, ` cfg(c) ` will not be displayed in the docs.
You can’t perform that action at this time.
0 commit comments