diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2021-09-28 18:03:12 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2021-09-28 18:03:12 +0100 |
| commit | d0fb9db6482b534473bd6d54013937580688ff3e (patch) | |
| tree | 8b83127de75b92811796f27c6fd5e416afab60ac /src/tools/clippy/clippy_dev | |
| parent | 1d71ba862309d59df710078a845c8772ffb22aba (diff) | |
| parent | cb7915b00c235e9b5861564f3be78dba330980ee (diff) | |
| download | rust-d0fb9db6482b534473bd6d54013937580688ff3e.tar.gz rust-d0fb9db6482b534473bd6d54013937580688ff3e.zip | |
Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyup
Diffstat (limited to 'src/tools/clippy/clippy_dev')
| -rw-r--r-- | src/tools/clippy/clippy_dev/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/clippy/clippy_dev/src/bless.rs | 20 |
2 files changed, 5 insertions, 17 deletions
diff --git a/src/tools/clippy/clippy_dev/Cargo.toml b/src/tools/clippy/clippy_dev/Cargo.toml index d7d2655026b..4a13a452409 100644 --- a/src/tools/clippy/clippy_dev/Cargo.toml +++ b/src/tools/clippy/clippy_dev/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "clippy_dev" version = "0.0.1" -edition = "2018" +edition = "2021" [dependencies] bytecount = "0.6" diff --git a/src/tools/clippy/clippy_dev/src/bless.rs b/src/tools/clippy/clippy_dev/src/bless.rs index c4fa0a9aca7..daf0fcc993b 100644 --- a/src/tools/clippy/clippy_dev/src/bless.rs +++ b/src/tools/clippy/clippy_dev/src/bless.rs @@ -1,7 +1,6 @@ //! `bless` updates the reference files in the repo with changed output files //! from the last test run. -use std::env; use std::ffi::OsStr; use std::fs; use std::lazy::SyncLazy; @@ -10,17 +9,9 @@ use walkdir::WalkDir; use crate::clippy_project_root; -// NOTE: this is duplicated with tests/cargo/mod.rs What to do? -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"), -}); - static CLIPPY_BUILD_TIME: SyncLazy<Option<std::time::SystemTime>> = SyncLazy::new(|| { - let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".to_string()); - let mut path = PathBuf::from(&**CARGO_TARGET_DIR); - path.push(profile); - path.push("cargo-clippy"); + let mut path = std::env::current_exe().unwrap(); + path.set_file_name("cargo-clippy"); fs::metadata(path).ok()?.modified().ok() }); @@ -94,10 +85,7 @@ fn updated_since_clippy_build(path: &Path) -> Option<bool> { } fn build_dir() -> PathBuf { - let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".to_string()); - let mut path = PathBuf::new(); - path.push(CARGO_TARGET_DIR.clone()); - path.push(profile); - path.push("test_build_base"); + let mut path = std::env::current_exe().unwrap(); + path.set_file_name("test"); path } |
