about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_session/src/config/cfg.rs7
1 files changed, 5 insertions, 2 deletions
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);