trpl: add a small section outlining doctest configuration

This commit is contained in:
Kevin Butler 2015-11-03 16:42:25 +00:00
parent 8e23e2fbcb
commit 5ae1937129

View File

@ -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: