mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Fix run-pass tests when CARGO_TARGET_DIR is not set
This commit is contained in:
parent
c066807a70
commit
f940b04de6
@ -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 New Issue
Block a user