From 99952f3be254394a5c70ce8fb8436d76c779ed71 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 2 Oct 2020 21:16:22 +0300 Subject: Fix the hover dash issues --- crates/project_model/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/project_model') diff --git a/crates/project_model/src/lib.rs b/crates/project_model/src/lib.rs index 258f60e28..d1e7602fc 100644 --- a/crates/project_model/src/lib.rs +++ b/crates/project_model/src/lib.rs @@ -411,7 +411,7 @@ impl ProjectWorkspace { let crate_id = crate_graph.add_crate_root( file_id, edition, - Some(cargo[pkg].name.clone()), + Some(CrateName::normalize_dashes(&cargo[pkg].name)), cfg_options, env, proc_macro.clone(), @@ -546,7 +546,8 @@ fn sysroot_to_crate_graph( let env = Env::default(); let proc_macro = vec![]; - let name = sysroot[krate].name.clone(); + let name = CrateName::new(&sysroot[krate].name) + .expect("Sysroot crates' names do not contain dashes"); let crate_id = crate_graph.add_crate_root( file_id, Edition::Edition2018, -- cgit v1.2.3