From 2737b26c2e5eee9229663552d0c70e2affbb8511 Mon Sep 17 00:00:00 2001 From: Jacob Adam Date: Sat, 14 Feb 2026 12:01:38 +0000 Subject: [PATCH] Fix the compile-test tests when setting Cargo's `build.build-dir` setting to a path that's distinct from `target-dir`. --- tests/compile-test.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/compile-test.rs b/tests/compile-test.rs index fa2b6cf26806..a1f3224a5da9 100644 --- a/tests/compile-test.rs +++ b/tests/compile-test.rs @@ -197,10 +197,6 @@ fn base_config(&self, test_dir: &str, mandatory_annotations: bool) -> Config { defaults.set_custom("diagnostic-collector", collector); } config.with_args(&self.args); - let current_exe_path = env::current_exe().unwrap(); - let deps_path = current_exe_path.parent().unwrap(); - let profile_path = deps_path.parent().unwrap(); - config.program.args.extend( [ "--emit=metadata", @@ -224,6 +220,7 @@ fn base_config(&self, test_dir: &str, mandatory_annotations: bool) -> Config { config.program.args.push(format!("--sysroot={sysroot}").into()); } + let profile_path = target_dir.join(env!("PROFILE")); config.program.program = profile_path.join(if cfg!(windows) { "clippy-driver.exe" } else {