File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,26 @@ to it in the docs. But if you include this:
103
103
104
104
it will not.
105
105
106
+ ### ` test(no_crate_inject) `
107
+
108
+ By default, ` rustdoc ` will automatically add a line with ` extern crate my_crate; ` into each doctest.
109
+ But if you include this:
110
+
111
+ ``` rust,ignore
112
+ #![doc(test(no_crate_inject))]
113
+ ```
114
+
115
+ it will not.
116
+
117
+ ### ` test(attr(...)) `
118
+
119
+ This form of the ` doc ` attribute allows you to add arbitrary attributes to all your doctests. For
120
+ example, if you want your doctests to fail if they produce any warnings, you could add this:
121
+
122
+ ``` rust,ignore
123
+ #![doc(test(attr(deny(warnings))))]
124
+ ```
125
+
106
126
## At the item level
107
127
108
128
These forms of the ` #[doc] ` attribute are used on individual items, to control how
You can’t perform that action at this time.
0 commit comments