提交 5ae19371 编写于 作者: K Kevin Butler

trpl: add a small section outlining doctest configuration

上级 8e23e2fb
......@@ -620,6 +620,18 @@ You can control a few aspects of the HTML that `rustdoc` generates through the
This sets a few different options, with a logo, favicon, and a root URL.
### Configuring documentation tests
You can also configure the way that `rustdoc` tests your documentation examples
through the `#![doc(test(..))]` attribute.
```rust
#![doc(test(attr(allow(unused_variables), deny(warnings))))]
```
This allows unused variables within the examples, but will fail the test for any
other lint warning thrown.
## Generation options
`rustdoc` also contains a few other options on the command line, for further customization:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册