mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Fix run-pass tests when CARGO_TARGET_DIR is not set
This commit is contained in:
parent
c066807a70
commit
f940b04de6
1 changed files with 2 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
|||
use cargo_metadata::MetadataCommand;
|
||||
use lazy_static::lazy_static;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
@ -6,7 +7,7 @@ lazy_static! {
|
|||
pub static ref CARGO_TARGET_DIR: PathBuf = {
|
||||
match env::var_os("CARGO_TARGET_DIR") {
|
||||
Some(v) => v.into(),
|
||||
None => "target".into(),
|
||||
None => MetadataCommand::new().exec().unwrap().target_directory,
|
||||
}
|
||||
};
|
||||
pub static ref TARGET_LIB: PathBuf = {
|
||||
|
|
Loading…
Reference in a new issue