Recently, custom target specs were gated behind a -Z json-target-spec flag. Trying to build with a custom target spec now prints:
error: `.json` target specs require -Zjson-target-spec to be added to the cargo invocation
There is nothing in the unstable section of the Cargo book that suggests the existence of json-target-spec, which makes it seem like this is a command line flag that exists outside of Cargo's normal unstable feature system (and therefore cannot be configured through .cargo/config.toml). However, the feature is actually documented under the name target-spec-json. -Ztarget-spec-json (or [unstable] target-spec-json = true in .cargo/config.toml) does not work, so this appears to be a typo in the documentation.
Cargo version:
cargo 1.97.0-nightly (eb94155a9 2026-04-09)
release: 1.97.0-nightly
commit-hash: eb94155a9a60943bd7b1cb04abec42f5d0de6ddc
commit-date: 2026-04-09
host: x86_64-unknown-linux-gnu
libgit2: 1.9.2 (sys:0.20.4 vendored)
libcurl: 8.19.0-DEV (sys:0.4.87+curl-8.19.0 vendored ssl:OpenSSL/3.5.4)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Arch Linux Rolling Release [64-bit]
Recently, custom target specs were gated behind a
-Z json-target-specflag. Trying to build with a custom target spec now prints:There is nothing in the unstable section of the Cargo book that suggests the existence of
json-target-spec, which makes it seem like this is a command line flag that exists outside of Cargo's normal unstable feature system (and therefore cannot be configured through.cargo/config.toml). However, the feature is actually documented under the nametarget-spec-json.-Ztarget-spec-json(or[unstable] target-spec-json = truein.cargo/config.toml) does not work, so this appears to be a typo in the documentation.Cargo version: