

Add -Z check-cfg-features to enable compile-time checking of features by Urgau ·...
source link: https://github.com/rust-lang/cargo/pull/10408
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

This pull-request implements the "Cargo support" section of RFC 3013: Checking conditional compilation at compile time.
The support is added in the form of an new unstable flags: -Z check-cfg-features
that pass all possible features of a package to rustc
unstable --check-cfg
command line as --check-cfg=values(feature, ...)
. This enables compile time checking of feature
values in #[cfg]
, cfg!
and #[cfg_attr]
.
This new flag currently only affects rustc
but rustdoc
support will be added as soon as it's support is merged.
Note than the intent is that this command line options become the default when stabilizing as suggested in the RFC:
[..] it seems uncontroversial for Cargo to enable checking for feature = "..." values immediately [..]
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK