mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
13 lines
355 B
Rust
13 lines
355 B
Rust
use std::env;
|
|
use std::lazy::SyncLazy;
|
|
use std::path::PathBuf;
|
|
|
|
pub static CARGO_TARGET_DIR: SyncLazy<PathBuf> = SyncLazy::new(|| match env::var_os("CARGO_TARGET_DIR") {
|
|
Some(v) => v.into(),
|
|
None => env::current_dir().unwrap().join("target"),
|
|
});
|
|
|
|
#[must_use]
|
|
pub fn is_rustc_test_suite() -> bool {
|
|
option_env!("RUSTC_TEST_SUITE").is_some()
|
|
}
|