Skip to content

Commit

Permalink
Add documentation for --check-cfg in rustdoc book
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Feb 25, 2022
1 parent 9705939 commit a31ae15
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/doc/rustdoc/src/unstable-features.md
Expand Up @@ -512,3 +512,17 @@ crate being documented (`foobar`) and a path to output the calls

To scrape examples from test code, e.g. functions marked `#[test]`, then
add the `--scrape-tests` flag.

### `--check-cfg`: check configuration flags

This flag accepts the same values as `rustc --check-cfg`, and uses it to check configuration flags.

Using this flag looks like this:

```bash
$ rustdoc src/lib.rs -Z unstable-options \
--check-cfg='names()' --check-cfg='values(feature, "foo", "bar")'
```

The example above check every well known names (`target_os`, `doc`, `test`, ... via `names()`)
and check the values of `feature`: `foo` and `bar`.

0 comments on commit a31ae15

Please sign in to comment.