From 57d088a1a771a5a469a1f3a6846fe0cde2e3799a Mon Sep 17 00:00:00 2001 From: Urgau <3616612+Urgau@users.noreply.github.com> Date: Mon, 3 Mar 2025 21:46:40 +0100 Subject: [PATCH 1/2] Mention `explicit_builtin_cfgs_in_flags` lint cfg chapter --- src/conditional-compilation.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index 95eafcaa0..ee08a04fd 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -89,6 +89,8 @@ configuration option from within the source code of the crate being compiled. > [!WARNING] > Arbitrarily-set configuration options can clash with compiler-set configuration options. For example, it is possible to do `rustc --cfg "unix" program.rs` while compiling to a Windows target, and have both `unix` and `windows` configuration options set at the same time. Doing this would be unwise. +> +> Since Rust 1.82 `rustc` prevents setting configuration options that can clash with it's set of builtin configurations with the deny-by-default [`explicit_builtin_cfgs_in_flags`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags) lint. r[cfg.target_arch] ### `target_arch` From 8319abcc7e35a4c529ec118d0da65c6e65345ec4 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 5 Mar 2025 17:53:01 -0800 Subject: [PATCH 2/2] Remove warning about arbitrarily set CLI cfgs Now that explicit_builtin_cfgs_in_flags is deny-by-default, I don't think we need this warning anymore. --- src/conditional-compilation.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/conditional-compilation.md b/src/conditional-compilation.md index ee08a04fd..fb081f55c 100644 --- a/src/conditional-compilation.md +++ b/src/conditional-compilation.md @@ -87,11 +87,6 @@ configuration option from within the source code of the crate being compiled. > by [Cargo][cargo-feature] for specifying compile-time options and optional > dependencies. -> [!WARNING] -> Arbitrarily-set configuration options can clash with compiler-set configuration options. For example, it is possible to do `rustc --cfg "unix" program.rs` while compiling to a Windows target, and have both `unix` and `windows` configuration options set at the same time. Doing this would be unwise. -> -> Since Rust 1.82 `rustc` prevents setting configuration options that can clash with it's set of builtin configurations with the deny-by-default [`explicit_builtin_cfgs_in_flags`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags) lint. - r[cfg.target_arch] ### `target_arch`