
Checking Conditional Configurations - The rustc book
rustc supports checking that every reachable 1 #[cfg] matches a list of the expected config names and values. This can help with verifying that the crate is correctly handling conditional …
Automatic checking of cfgs at compile-time | Rust Blog
The syntax to use is described in the rustc book section checking configuration, but in a nutshell the basic syntax of --check-cfg is: cfg(name, values("value1", "value2", ..., "valueN"))
编译时自动检查 cfgs | Rust 博客
2024年5月5日 · Cargo 和编译器团队很高兴地宣布,从 Rust 1.80(或 nightly-2024-05-05)开始,每个 可达到的 #[cfg] 都将 自动检查 它们是否与 预期的配置名称和值 匹配。 这有助于验证 …
check_cfg - The Rust Unstable Book
This feature enables checking of conditional configuration. rustc accepts the --check-cfg option, which specifies whether to check conditions and how to check them. The --check-cfg option …
rust/src/doc/rustc/src/check-cfg.md at master - GitHub
rustc supports checking that every reachable 1 # [cfg] matches a list of the expected config names and values. This can help with verifying that the crate is correctly handling conditional …
2411rust,编译时自动检查配置_rust cargo设定代码检查选项-CSDN …
2024年11月18日 · Cargo 和 编译器 团队很高兴地 宣布,从 Rust1.80 (或 nightly-2024-05-05)开始,会 自动检查 每个可访问的 #[cfg],看看是否与期望的 配置名和值 匹配. 这帮助验证 crate,是否 …
检查条件配置 - The rustc book - Rust 编程语言
rustc --check-cfg 'cfg(name, values("value1", "value2", ... "valueN"))' 其中 name 是裸标识符(没有引号),每个 "value" 项都是带引号的字面字符串。 name 指定条件的名称,例如 feature 或 …
Automatic checking of cfgs at compile-time | Rust Blog
2024年5月6日 · It's not obvious to me how to write a build script that adds cargo::rustc-check-cfg only when the current version of Rust is >= 1.77. Yay! A feature that currently generates …
1.80 - Rust语言圣经 (Rust Course)
在 1.79 版本中,rustc 稳定了一个 --check-cfg 标志,现在 Cargo 1.80 为所有的 cfg 名称和值启用了这些检查(除了 rustc 中 已知的名称和值)。 这包括来自 Cargo.toml 的特性名称以及来自 …
Cargo Specifics - The rustc book - Learn Rust
When using a statically known custom config (i.e., not dependent on a build-script), Cargo provides the custom lint config check-cfg under [lints.rust.unexpected_cfgs]. It can be used to …