File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use std::path::PathBuf;
11
11
// code. See https://github.com/rust-analyzer/rust-analyzer/issues/3517 and https://github.com/rust-lang/rust-clippy/issues/5514 for details
12
12
13
13
pub fn run ( rustc_path : Option < & str > ) {
14
- // we can unwrap here because the arg is required here
14
+ // we can unwrap here because the arg is required by clap
15
15
let rustc_path = PathBuf :: from ( rustc_path. unwrap ( ) ) ;
16
16
assert ! ( rustc_path. is_dir( ) , "path is not a directory" ) ;
17
17
let rustc_source_basedir = rustc_path. join ( "compiler" ) ;
@@ -49,6 +49,15 @@ fn inject_deps_into_manifest(
49
49
cargo_toml : & str ,
50
50
lib_rs : & str ,
51
51
) -> std:: io:: Result < ( ) > {
52
+ // do not inject deps if we have aleady done so
53
+ if cargo_toml. contains ( "[target.'cfg(NOT_A_PLATFORM)'.dependencies]" ) {
54
+ eprintln ! (
55
+ "cargo dev ra-setup: warning: deps already found inside {}, doing nothing." ,
56
+ manifest_path
57
+ ) ;
58
+ return Ok ( ( ) ) ;
59
+ }
60
+
52
61
let extern_crates = lib_rs
53
62
. lines ( )
54
63
// get the deps
You can’t perform that action at this time.
0 commit comments