@@ -83,7 +83,6 @@ For the latest nightly, see the [nightly version] of this page.
8383 * [ build-std-features] ( #build-std-features ) --- Sets features to use with the standard library.
8484 * [ binary-dep-depinfo] ( #binary-dep-depinfo ) --- Causes the dep-info file to track binary dependencies.
8585 * [ panic-abort-tests] ( #panic-abort-tests ) --- Allows running tests with the "abort" panic strategy.
86- * [ check-cfg] ( #check-cfg ) --- Compile-time validation of ` cfg ` expressions.
8786 * [ host-config] ( #host-config ) --- Allows setting ` [target] ` -like configuration settings for host build targets.
8887 * [ target-applies-to-host] ( #target-applies-to-host ) --- Alters whether certain flags will be passed to host build targets.
8988 * [ gc] ( #gc ) --- Global cache garbage collection.
@@ -1141,44 +1140,6 @@ You can use the flag like this:
11411140cargo rustdoc -Z unstable-options --output-format json
11421141```
11431142
1144- ## check-cfg
1145-
1146- * RFC: [ #3013 ] ( https://github.com/rust-lang/rfcs/pull/3013 )
1147- * Tracking Issue: [ #10554 ] ( https://github.com/rust-lang/cargo/issues/10554 )
1148-
1149- ` -Z check-cfg ` command line enables compile time checking of Cargo features as well as ` rustc `
1150- well known names and values in ` #[cfg] ` , ` cfg! ` , ` #[link] ` and ` #[cfg_attr] ` with the ` rustc `
1151- and ` rustdoc ` unstable ` --check-cfg ` command line.
1152-
1153- You can use the flag like this:
1154-
1155- ```
1156- cargo check -Z unstable-options -Z check-cfg
1157- ```
1158-
1159- ### ` cargo::rustc-check-cfg=CHECK_CFG `
1160-
1161- The ` rustc-check-cfg ` instruction tells Cargo to pass the given value to the
1162- ` --check-cfg ` flag to the compiler. This may be used for compile-time
1163- detection of unexpected conditional compilation name and/or values.
1164-
1165- This can only be used in combination with ` -Zcheck-cfg ` otherwise it is ignored
1166- with a warning.
1167-
1168- If you want to integrate with Cargo features, only use ` -Zcheck-cfg ` instead of
1169- trying to do it manually with this option.
1170-
1171- You can use the instruction like this:
1172-
1173- ``` rust,no_run
1174- // build.rs
1175- println!("cargo::rustc-check-cfg=cfg(foo, bar)");
1176- ```
1177-
1178- ```
1179- cargo check -Z unstable-options -Z check-cfg
1180- ```
1181-
11821143## codegen-backend
11831144
11841145The ` codegen-backend ` feature makes it possible to select the codegen backend used by rustc using a profile.
@@ -1785,3 +1746,11 @@ The `-Z registry-auth` feature has been stabilized in the 1.74 release with the
17851746requirement that a credential-provider is configured.
17861747
17871748See [ Registry Authentication] ( registry-authentication.md ) documentation for details.
1749+
1750+ ## check-cfg
1751+
1752+ The ` -Z check-cfg ` feature has been stabilized in the CURRENT_CARGO_RELEASE release by
1753+ making it the default behavior.
1754+
1755+ See the [ build script documentation] ( build-scripts.md#rustc-check-cfg ) for informations
1756+ about specifying custom cfgs.
0 commit comments