about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2025-06-30 15:16:22 +0800
committerJieyou Xu <jieyouxu@outlook.com>2025-06-30 15:17:28 +0800
commite664e7e1166d4b15e7631c9e5014f107449e8d06 (patch)
tree560c2fb1f5671ffc87aecc77cc83b02b8bc3e0bc
parentf03074da23c4b3e4e8ffcff3408151929a583fdf (diff)
downloadrust-e664e7e1166d4b15e7631c9e5014f107449e8d06.tar.gz
rust-e664e7e1166d4b15e7631c9e5014f107449e8d06.zip
Move `RUST_TEST_NOCAPTURE` warning to early config check
-rw-r--r--src/tools/compiletest/src/lib.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index c1a4839605c..23a4dd73796 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -51,12 +51,6 @@ use crate::util::logv;
 /// some code here that inspects environment variables or even runs executables
 /// (e.g. when discovering debugger versions).
 pub fn parse_config(args: Vec<String>) -> Config {
-    if env::var("RUST_TEST_NOCAPTURE").is_ok() {
-        eprintln!(
-            "WARNING: RUST_TEST_NOCAPTURE is not supported. Use the `--no-capture` flag instead."
-        );
-    }
-
     let mut opts = Options::new();
     opts.reqopt("", "compile-lib-path", "path to host shared libraries", "PATH")
         .reqopt("", "run-lib-path", "path to target shared libraries", "PATH")
@@ -1125,4 +1119,11 @@ WARNING: profiler runtime is not available, so `.coverage` files won't be {actio
 help: try setting `profiler = true` in the `[build]` section of `bootstrap.toml`"#
         );
     }
+
+    // `RUST_TEST_NOCAPTURE` is a libtest env var, but we don't callout to libtest.
+    if env::var("RUST_TEST_NOCAPTURE").is_ok() {
+        eprintln!(
+            "WARNING: RUST_TEST_NOCAPTURE is not supported. Use the `--no-capture` flag instead."
+        );
+    }
 }