Skip to content

Commit

Permalink
Add documentation for -Zcheck-target-cfgs
Browse files Browse the repository at this point in the history
  • Loading branch information
Urgau committed Sep 23, 2024
1 parent bd376fb commit 2d1762d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/doc/src/reference/unstable.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ Each new feature described below should explain how to use it.
* [lockfile-path](#lockfile-path) --- Allows to specify a path to lockfile other than the default path `<workspace_root>/Cargo.lock`.
* [package-workspace](#package-workspace) --- Allows for packaging and publishing multiple crates in a workspace.
* [native-completions](#native-completions) --- Move cargo shell completions to native completions.
* [check-target-cfgs](#check-target-cfgs) --- Allows checking unexpected cfgs in `[target.'cfg(...)']`

## allow-features

Expand Down Expand Up @@ -1728,6 +1729,29 @@ When in doubt, you can discuss this in [#14520](https://github.com/rust-lang/car
- powershell:
Add `CARGO_COMPLETE=powershell cargo +nightly | Invoke-Expression` to `$PROFILE`.

## check-target-cfgs

* Tracking Issue: [#00000](https://github.com/rust-lang/cargo/issues/00000)

This feature checks for unexpected cfgs in `[target.'cfg(...)']` entries, based
on `rustc --print=check-cfg`. It does **not** follow `RUSTFLAGS` but instead use
the lint configuration.

```sh
cargo check -Zcheck-target-cfgs
```

It follows the lint Rust `unexpected_cfgs` lint configuration:

```toml
[target.'cfg(foo)'.dependencies]
cfg-if = "1.0"

[lints.rust.unexpected_cfgs]
level = "warn"
check-cfg = ['cfg(foo)']
```

# Stabilized and removed features

## Compile progress
Expand Down

0 comments on commit 2d1762d

Please sign in to comment.