about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2024-09-17 23:55:53 +0200
committerUrgau <urgau@numericable.fr>2025-01-02 16:49:55 +0100
commite8a4792b3e5ffa85453451ba27026de3a48c1581 (patch)
tree3c3ee4c44923be08317ddef12e16b4e95d4814d4 /src
parentbc3e3015b6e449bf1607f1023d2fbc2838ee37af (diff)
downloadrust-e8a4792b3e5ffa85453451ba27026de3a48c1581.tar.gz
rust-e8a4792b3e5ffa85453451ba27026de3a48c1581.zip
Make the `test` cfg a "userspace" check-cfg
Diffstat (limited to 'src')
-rw-r--r--src/doc/rustc/src/check-cfg.md6
-rw-r--r--src/tools/compiletest/src/runtest.rs5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/doc/rustc/src/check-cfg.md b/src/doc/rustc/src/check-cfg.md
index 992f14a79bf..f7e831dc8bd 100644
--- a/src/doc/rustc/src/check-cfg.md
+++ b/src/doc/rustc/src/check-cfg.md
@@ -99,7 +99,7 @@ the need to specify them manually.
 Well known names and values are implicitly added as long as at least one `--check-cfg` argument
 is present.
 
-As of `2024-08-20T`, the list of known names is as follows:
+As of `2025-01-02T`, the list of known names is as follows:
 
 <!--- See CheckCfg::fill_well_known in compiler/rustc_session/src/config.rs -->
 
@@ -130,11 +130,13 @@ As of `2024-08-20T`, the list of known names is as follows:
  - `target_pointer_width`
  - `target_thread_local`
  - `target_vendor`
- - `test`
  - `ub_checks`
  - `unix`
  - `windows`
 
+> Starting with CURRENT_RUSTC_VERSION, the `test` cfg is consider to be a "userspace" config
+> despite being also set by `rustc` and should be managed by the build-system it-self.
+
 Like with `values(any())`, well known names checking can be disabled by passing `cfg(any())`
 as argument to `--check-cfg`.
 
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 7084c407a64..9e8443cd13c 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -506,8 +506,9 @@ impl<'test> TestCx<'test> {
             // Generate `cfg(FALSE, REV1, ..., REVN)` (for all possible revisions)
             //
             // For compatibility reason we consider the `FALSE` cfg to be expected
-            // since it is extensively used in the testsuite.
-            check_cfg.push_str("cfg(FALSE");
+            // since it is extensively used in the testsuite, as well as the `test`
+            // cfg since we have tests that uses it.
+            check_cfg.push_str("cfg(test,FALSE");
             for revision in &self.props.revisions {
                 check_cfg.push(',');
                 check_cfg.push_str(&normalize_revision(revision));