aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/mock_analysis.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-05 10:49:25 +0000
committerGitHub <[email protected]>2020-02-05 10:49:25 +0000
commit514ff113cbc9827d88cbe9368e8e4fa5875bc3db (patch)
tree05035ebe7c248dc4756aac09bd5c310ffe173707 /crates/ra_ide/src/mock_analysis.rs
parentc9e1aab8803264a40023aa09600b0a8fab8e00ff (diff)
parent78092c7c66a665ada55ea09476a387014f6665b0 (diff)
Merge #3017
3017: Normalize dashes in crate names r=matklad a=SomeoneToIgnore A follow-up for https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Yet.20another.20auto.20import.20bug In theory, I could have used the same new type in the `Dependency` `name` field, but since the `add_dep` method that actually adds a dependency is private, it seems like an unnecessary change now. Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/mock_analysis.rs')
-rw-r--r--crates/ra_ide/src/mock_analysis.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs
index bf8a54932..081aaee8c 100644
--- a/crates/ra_ide/src/mock_analysis.rs
+++ b/crates/ra_ide/src/mock_analysis.rs
@@ -3,7 +3,7 @@
3use std::sync::Arc; 3use std::sync::Arc;
4 4
5use ra_cfg::CfgOptions; 5use ra_cfg::CfgOptions;
6use ra_db::{Env, RelativePathBuf}; 6use ra_db::{CrateName, Env, RelativePathBuf};
7use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; 7use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER};
8 8
9use crate::{ 9use crate::{
@@ -107,7 +107,9 @@ impl MockAnalysis {
107 crate_graph.add_crate_root(file_id, Edition2018, cfg_options, Env::default()); 107 crate_graph.add_crate_root(file_id, Edition2018, cfg_options, Env::default());
108 let crate_name = path.parent().unwrap().file_name().unwrap(); 108 let crate_name = path.parent().unwrap().file_name().unwrap();
109 if let Some(root_crate) = root_crate { 109 if let Some(root_crate) = root_crate {
110 crate_graph.add_dep(root_crate, crate_name.into(), other_crate).unwrap(); 110 crate_graph
111 .add_dep(root_crate, CrateName::new(crate_name).unwrap(), other_crate)
112 .unwrap();
111 } 113 }
112 } 114 }
113 change.add_file(source_root, file_id, path, Arc::new(contents)); 115 change.add_file(source_root, file_id, path, Arc::new(contents));