How to set `-Zcheck-cfg` option in config.toml?

Recently Rust nightly support -Zcheck-cfg option to -- Specify scope of compile-time checking of cfg names/values. It can be attached to command line option as -Zcheck-cfg=features,names,values,output; but can't be added to config.toml unstable section. Such as in .cargo/config.toml

[unstable]
check-cfg=["features","names","values","output"]

compiler says error: invalid type: string "features", expected a boolean

Anyone knows how to set it up?

1 Like

For features checking I think you should use check-cfg-features = true.

check-cfg-features has been deprecated.
https://github.com/rust-lang/rust/issues/82450#issuecomment-1133403998
The new --check-cfg covers all features names values ...

https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html

But config options still confuse me a lot.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.