diff options
| author | Loïc BRANSTETT <lolo.branstett@numericable.fr> | 2022-02-20 17:13:38 +0100 |
|---|---|---|
| committer | Loïc BRANSTETT <lolo.branstett@numericable.fr> | 2022-02-25 02:18:50 +0100 |
| commit | a31ae159bc29ae26396160b1f3cb0fb358b4eae7 (patch) | |
| tree | 9f7f54144f871c34e090d2136a0995f389c8cf93 /src/doc/rustdoc | |
| parent | 97059397caa797cd9a56585d43c2ee873baf9cde (diff) | |
| download | rust-a31ae159bc29ae26396160b1f3cb0fb358b4eae7.tar.gz rust-a31ae159bc29ae26396160b1f3cb0fb358b4eae7.zip | |
Add documentation for `--check-cfg` in rustdoc book
Diffstat (limited to 'src/doc/rustdoc')
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index c7fd5ed6fcb..141d5d2d2b2 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -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`. |
