File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1201,6 +1201,7 @@ It's values are:
1201
1201
Note than this command line options will probably become the default when stabilizing.
1202
1202
- ` names ` : enables well known names checking via ` --check-cfg=names() ` .
1203
1203
- ` values ` : enables well known values checking via ` --check-cfg=values() ` .
1204
+ - ` output ` : enable the use of ` rustc-check-cfg ` in build script.
1204
1205
1205
1206
For instance:
1206
1207
@@ -1211,6 +1212,29 @@ cargo check -Z unstable-options -Z check-cfg=values
1211
1212
cargo check -Z unstable-options -Z check-cfg=features,names,values
1212
1213
```
1213
1214
1215
+ Or for ` output ` :
1216
+
1217
+ ``` rust,no_run
1218
+ // build.rs
1219
+ println!("cargo:rustc-check-cfg=names(foo, bar)");
1220
+ ```
1221
+
1222
+ ```
1223
+ cargo check -Z unstable-options -Z check-cfg=output
1224
+ ```
1225
+
1226
+ ### ` cargo:rustc-check-cfg=CHECK_CFG `
1227
+
1228
+ The ` rustc-check-cfg ` instruction tells Cargo to pass the given value to the
1229
+ ` --check-cfg ` flag to the compiler. This may be used for compile-time
1230
+ detection of unexpected conditional compilation name and/or values.
1231
+
1232
+ This can only be used in combination with ` -Zcheck-cfg=output ` otherwise it is ignored
1233
+ with a warning.
1234
+
1235
+ If you want to integrate with Cargo features, use ` -Zcheck-cfg=features ` instead of
1236
+ trying to do it manually with this option.
1237
+
1214
1238
### workspace-inheritance
1215
1239
1216
1240
* RFC: [ #2906 ] ( https://github.com/rust-lang/rfcs/blob/master/text/2906-cargo-workspace-deduplicate.md )
You can’t perform that action at this time.
0 commit comments