File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
crates/ra_project_model/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -336,7 +336,7 @@ impl ProjectWorkspace {
336336 extern_source,
337337 ) ;
338338 if cargo[ tgt] . kind == TargetKind :: Lib {
339- lib_tgt = Some ( crate_id) ;
339+ lib_tgt = Some ( ( crate_id, cargo [ tgt ] . name . clone ( ) ) ) ;
340340 pkg_to_lib_crate. insert ( pkg, crate_id) ;
341341 }
342342 if cargo[ tgt] . is_proc_macro {
@@ -363,15 +363,15 @@ impl ProjectWorkspace {
363363
364364 // Set deps to the core, std and to the lib target of the current package
365365 for & from in pkg_crates. get ( & pkg) . into_iter ( ) . flatten ( ) {
366- if let Some ( to ) = lib_tgt {
366+ if let Some ( ( to , name ) ) = lib_tgt. clone ( ) {
367367 if to != from
368368 && crate_graph
369369 . add_dep (
370370 from,
371371 // For root projects with dashes in their name,
372372 // cargo metadata does not do any normalization,
373373 // so we do it ourselves currently
374- CrateName :: normalize_dashes ( & cargo [ pkg ] . name ) ,
374+ CrateName :: normalize_dashes ( & name) ,
375375 to,
376376 )
377377 . is_err ( )
You can’t perform that action at this time.
0 commit comments