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 {