File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 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;
1111// code. See https://github.com/rust-analyzer/rust-analyzer/issues/3517 and https://github.com/rust-lang/rust-clippy/issues/5514 for details
1212
1313pub 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
1515 let rustc_path = PathBuf :: from ( rustc_path. unwrap ( ) ) ;
1616 assert ! ( rustc_path. is_dir( ) , "path is not a directory" ) ;
1717 let rustc_source_basedir = rustc_path. join ( "compiler" ) ;
@@ -49,6 +49,15 @@ fn inject_deps_into_manifest(
4949 cargo_toml : & str ,
5050 lib_rs : & str ,
5151) -> 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+
5261 let extern_crates = lib_rs
5362 . lines ( )
5463 // get the deps
You can’t perform that action at this time.
0 commit comments