Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(doc): syntax of rustc-check-cfg instruction #13573

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ You can use the flag like this:
cargo check -Z unstable-options -Z check-cfg
```

### `cargo::rustc-check-cfg=CHECK_CFG`
### `cargo:rustc-check-cfg=CHECK_CFG`

The `rustc-check-cfg` instruction tells Cargo to pass the given value to the
`--check-cfg` flag to the compiler. This may be used for compile-time
Expand All @@ -1157,7 +1157,8 @@ You can use the instruction like this:

```rust,no_run
// build.rs
println!("cargo::rustc-check-cfg=cfg(foo, bar)");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this is valid; this defines two different cfgs foo and bar, not one foo="bar".

But I agree this isn't the best example.

println!("cargo:rustc-check-cfg=cfg(foo)");
println!("cargo:rustc-check-cfg=cfg(bar, values(\"first\", \"second\"))");
```

```
Expand Down