File tree 3 files changed +3
-20
lines changed
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> {
85
85
}
86
86
87
87
fn 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" ) ;
93
90
path
94
91
}
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
-
10
1
#[ must_use]
11
2
pub fn is_rustc_test_suite ( ) -> bool {
12
3
option_env ! ( "RUSTC_TEST_SUITE" ) . is_some ( )
Original file line number Diff line number Diff line change 1
1
#![ feature( test) ] // compiletest_rs requires this attribute
2
- #![ feature( once_cell) ]
3
2
#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
4
3
#![ warn( rust_2018_idioms, unused_lifetimes) ]
5
4
@@ -46,10 +45,6 @@ extern crate quote;
46
45
#[ allow( unused_extern_crates) ]
47
46
extern crate syn;
48
47
49
- fn host_lib ( ) -> PathBuf {
50
- option_env ! ( "HOST_LIBS" ) . map_or ( cargo:: CARGO_TARGET_DIR . join ( env ! ( "PROFILE" ) ) , PathBuf :: from)
51
- }
52
-
53
48
/// Produces a string with an `--extern` flag for all UI test crate
54
49
/// dependencies.
55
50
///
@@ -133,7 +128,7 @@ fn default_config() -> compiletest::Config {
133
128
extern_flags( ) ,
134
129
) ) ;
135
130
136
- config. build_base = host_lib ( ) . join ( "test_build_base" ) ;
131
+ config. build_base = profile_path . join ( "test_build_base" ) ;
137
132
config. rustc_path = profile_path. join ( if cfg ! ( windows) {
138
133
"clippy-driver.exe"
139
134
} else {
You can’t perform that action at this time.
0 commit comments