We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dcd343b commit 5fbadfcCopy full SHA for 5fbadfc
src/doc/rustdoc/src/the-doc-attribute.md
@@ -103,6 +103,26 @@ to it in the docs. But if you include this:
103
104
it will not.
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
123
+#![doc(test(attr(deny(warnings))))]
124
125
126
## At the item level
127
128
These forms of the `#[doc]` attribute are used on individual items, to control how
0 commit comments