File tree Expand file tree Collapse file tree 3 files changed +3
-20
lines changed Expand file tree Collapse file tree 3 files changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,7 @@ fn updated_since_clippy_build(path: &Path) -> Option<bool> {
8585}
8686
8787fn build_dir ( ) -> PathBuf {
88- let profile = env:: var ( "PROFILE" ) . unwrap_or_else ( |_| "debug" . to_string ( ) ) ;
89- let mut path = PathBuf :: new ( ) ;
90- path. push ( CARGO_TARGET_DIR . clone ( ) ) ;
91- path. push ( profile) ;
92- path. push ( "test_build_base" ) ;
88+ let mut path = std:: env:: current_exe ( ) . unwrap ( ) ;
89+ path. set_file_name ( "test_build_base" ) ;
9390 path
9491}
Original file line number Diff line number Diff line change 1- use std:: env;
2- use std:: lazy:: SyncLazy ;
3- use std:: path:: PathBuf ;
4-
5- pub static CARGO_TARGET_DIR : SyncLazy < PathBuf > = SyncLazy :: new ( || match env:: var_os ( "CARGO_TARGET_DIR" ) {
6- Some ( v) => v. into ( ) ,
7- None => env:: current_dir ( ) . unwrap ( ) . join ( "target" ) ,
8- } ) ;
9-
101#[ must_use]
112pub fn is_rustc_test_suite ( ) -> bool {
123 option_env ! ( "RUSTC_TEST_SUITE" ) . is_some ( )
Original file line number Diff line number Diff line change 11#![ feature( test) ] // compiletest_rs requires this attribute
2- #![ feature( once_cell) ]
32#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
43#![ warn( rust_2018_idioms, unused_lifetimes) ]
54
@@ -46,10 +45,6 @@ extern crate quote;
4645#[ allow( unused_extern_crates) ]
4746extern crate syn;
4847
49- fn host_lib ( ) -> PathBuf {
50- option_env ! ( "HOST_LIBS" ) . map_or ( cargo:: CARGO_TARGET_DIR . join ( env ! ( "PROFILE" ) ) , PathBuf :: from)
51- }
52-
5348/// Produces a string with an `--extern` flag for all UI test crate
5449/// dependencies.
5550///
@@ -133,7 +128,7 @@ fn default_config() -> compiletest::Config {
133128 extern_flags( ) ,
134129 ) ) ;
135130
136- config. build_base = host_lib ( ) . join ( "test_build_base" ) ;
131+ config. build_base = profile_path . join ( "test_build_base" ) ;
137132 config. rustc_path = profile_path. join ( if cfg ! ( windows) {
138133 "clippy-driver.exe"
139134 } else {
You can’t perform that action at this time.
0 commit comments