From 828c7ef16f354bd50d9fa3930e0243a041e56256 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Fri, 26 Jul 2024 14:40:13 -0400 Subject: [PATCH] docs: clarify `target.'cfg(...)'` doesnt respect cfg from build script This was a mistake, see https://github.com/rust-lang/cargo/issues/14306 --- src/doc/src/reference/config.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index 965642cafc5..aab0097a57f 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -1173,9 +1173,9 @@ rustflags = ["…", "…"] ``` `cfg` values come from those built-in to the compiler (run `rustc --print=cfg` -to view), values set by [build scripts], and extra `--cfg` flags passed to -`rustc` (such as those defined in `RUSTFLAGS`). Do not try to match on -`debug_assertions` or Cargo features like `feature="foo"`. +to view) and extra `--cfg` flags passed to `rustc` (such as those defined in +`RUSTFLAGS`). Do not try to match on `debug_assertions`, `test`, Cargo features +like `feature="foo"`, or values set by [build scripts]. If using a target spec JSON file, the [``] value is the filename stem. For example `--target foo/bar.json` would match `[target.bar]`.