diff options
| author | flip1995 <philipp.krones@embecosm.com> | 2020-11-05 14:29:48 +0100 |
|---|---|---|
| committer | flip1995 <philipp.krones@embecosm.com> | 2020-11-05 14:29:48 +0100 |
| commit | 34244190d45d80bf66a0eec0d04f0254efd4c754 (patch) | |
| tree | 74a0de1b64324dc57f315f8af4670b1a7fc087ca /clippy_dev/src | |
| parent | 0c1531a5c4269b0d0bc7cff53420f936b42ce1ab (diff) | |
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup
Diffstat (limited to 'clippy_dev/src')
| -rw-r--r-- | clippy_dev/src/ra_setup.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clippy_dev/src/ra_setup.rs b/clippy_dev/src/ra_setup.rs index c67efc10f15..9d9e836cc08 100644 --- a/clippy_dev/src/ra_setup.rs +++ b/clippy_dev/src/ra_setup.rs @@ -11,7 +11,7 @@ use std::path::PathBuf; // code. See https://github.com/rust-analyzer/rust-analyzer/issues/3517 and https://github.com/rust-lang/rust-clippy/issues/5514 for details pub fn run(rustc_path: Option<&str>) { - // we can unwrap here because the arg is required here + // we can unwrap here because the arg is required by clap let rustc_path = PathBuf::from(rustc_path.unwrap()); assert!(rustc_path.is_dir(), "path is not a directory"); let rustc_source_basedir = rustc_path.join("compiler"); @@ -49,6 +49,15 @@ fn inject_deps_into_manifest( cargo_toml: &str, lib_rs: &str, ) -> std::io::Result<()> { + // do not inject deps if we have aleady done so + if cargo_toml.contains("[target.'cfg(NOT_A_PLATFORM)'.dependencies]") { + eprintln!( + "cargo dev ra-setup: warning: deps already found inside {}, doing nothing.", + manifest_path + ); + return Ok(()); + } + let extern_crates = lib_rs .lines() // get the deps |
