From e8a4792b3e5ffa85453451ba27026de3a48c1581 Mon Sep 17 00:00:00 2001 From: Urgau Date: Tue, 17 Sep 2024 23:55:53 +0200 Subject: Make the `test` cfg a "userspace" check-cfg --- compiler/rustc_session/src/config/cfg.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_session/src') diff --git a/compiler/rustc_session/src/config/cfg.rs b/compiler/rustc_session/src/config/cfg.rs index 3426858495b..b68dfeffa34 100644 --- a/compiler/rustc_session/src/config/cfg.rs +++ b/compiler/rustc_session/src/config/cfg.rs @@ -332,6 +332,11 @@ impl CheckCfg { // Note that symbols inserted conditionally in `default_configuration` // are inserted unconditionally here. // + // One exception is the `test` cfg which is consider to be a "user-space" + // cfg, despite being also set by in `default_configuration` above. + // It allows the build system to "deny" using the config by not marking it + // as expected (e.g. `lib.test = false` for Cargo). + // // When adding a new config here you should also update // `tests/ui/check-cfg/well-known-values.rs` (in order to test the // expected values of the new config) and bless the all directory. @@ -453,8 +458,6 @@ impl CheckCfg { ins!(sym::target_thread_local, no_values); - ins!(sym::test, no_values); - ins!(sym::ub_checks, no_values); ins!(sym::unix, no_values); -- cgit 1.4.1-3-g733a5