@@ -130,8 +130,6 @@ one detailed below.
130130 compiler.
131131* [ ` cargo::rustc-cfg=KEY[="VALUE"] ` ] ( #rustc-cfg ) --- Enables compile-time ` cfg `
132132 settings.
133- * [ ` cargo::rustc-check-cfg=CHECK_CFG ` ] ( #rustc-check-cfg ) -- Register custom ` cfg ` s as
134- expected for compile-time checking of configs.
135133* [ ` cargo::rustc-env=VAR=VALUE ` ] ( #rustc-env ) --- Sets an environment variable.
136134* [ ` cargo::rustc-cdylib-link-arg=FLAG ` ] ( #rustc-cdylib-link-arg ) --- Passes custom
137135 flags to a linker for cdylib crates.
@@ -235,10 +233,7 @@ equivalent to using [`rustc-link-lib`](#rustc-link-lib) and
235233
236234The ` rustc-cfg ` instruction tells Cargo to pass the given value to the
237235[ ` --cfg ` flag] [ option-cfg ] to the compiler. This may be used for compile-time
238- detection of features to enable [ conditional compilation] . Custom cfgs
239- must either be expected using the [ ` cargo::rustc-check-cfg ` ] ( #rustc-check-cfg )
240- instruction or usage will need to allow the [ ` unexpected_cfgs ` ] [ unexpected-cfgs ]
241- lint to avoid unexpected cfgs warnings.
236+ detection of features to enable [ conditional compilation] .
242237
243238Note that this does * not* affect Cargo's dependency resolution. This cannot be
244239used to enable an optional dependency, or enable other Cargo features.
@@ -254,41 +249,6 @@ identifier, the value should be a string.
254249[ cargo features ] : features.md
255250[ conditional compilation ] : ../../reference/conditional-compilation.md
256251[ option-cfg ] : ../../rustc/command-line-arguments.md#option-cfg
257- [ unexpected-cfgs ] : ../../rustc/lints/listing/warn-by-default.md#unexpected-cfgs
258-
259- ### ` cargo::rustc-check-cfg=CHECK_CFG ` {#rustc-check-cfg}
260-
261- Add to the list of expected config names and values that is used when checking
262- the _ reachable_ cfg expressions.
263-
264- For details on the syntax of ` CHECK_CFG ` , see ` rustc ` [ ` --check-cfg ` flag] [ option-check-cfg ] .
265- See also the [ ` unexpected_cfgs ` ] [ unexpected-cfgs ] lint.
266-
267- The instruction can be used like this:
268-
269- ``` rust,no_run
270- // build.rs
271- println!("cargo::rustc-check-cfg=cfg(foo, values(\"bar\"))");
272- ```
273-
274- Note that all possible cfgs should be defined, regardless of which cfgs are
275- currently enabled. This includes all possible values of a given cfg name.
276-
277- It is recommended to group the ` cargo::rustc-check-cfg ` and
278- [ ` cargo::rustc-cfg ` ] [ option-cfg ] instructions as closely as possible in order to
279- avoid typos, missing check-cfg, stalled cfgs...
280-
281- #### Example of using ` cargo::rustc-check-cfg ` and ` cargo::rustc-cfg ` together
282-
283- ``` rust,no_run
284- // build.rs
285- println!("cargo::rustc-check-cfg=cfg(foo, values(\"bar\"))");
286- if foo_bar_condition {
287- println!("cargo::rustc-cfg=foo=\"bar\"");
288- }
289- ```
290-
291- [ option-check-cfg ] : ../../rustc/command-line-arguments.md#option-check-cfg
292252
293253### ` cargo::rustc-env=VAR=VALUE ` {#rustc-env}
294254
0 commit comments