diff options
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/import_map.rs | 10 | ||||
-rw-r--r-- | crates/hir_def/src/nameres.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs index a442fb63a..44bfe1593 100644 --- a/crates/hir_def/src/import_map.rs +++ b/crates/hir_def/src/import_map.rs | |||
@@ -334,14 +334,14 @@ mod tests { | |||
334 | 334 | ||
335 | use super::*; | 335 | use super::*; |
336 | 336 | ||
337 | fn check_search(ra_fixture: &str, krate_name: &str, query: Query, expect: Expect) { | 337 | fn check_search(ra_fixture: &str, crate_name: &str, query: Query, expect: Expect) { |
338 | let db = TestDB::with_files(ra_fixture); | 338 | let db = TestDB::with_files(ra_fixture); |
339 | let crate_graph = db.crate_graph(); | 339 | let crate_graph = db.crate_graph(); |
340 | let krate = crate_graph | 340 | let krate = crate_graph |
341 | .iter() | 341 | .iter() |
342 | .find(|krate| { | 342 | .find(|krate| { |
343 | crate_graph[*krate].display_name.as_ref().map(|n| n.to_string()) | 343 | crate_graph[*krate].declaration_name.as_ref().map(|n| n.to_string()) |
344 | == Some(krate_name.to_string()) | 344 | == Some(crate_name.to_string()) |
345 | }) | 345 | }) |
346 | .unwrap(); | 346 | .unwrap(); |
347 | 347 | ||
@@ -359,7 +359,7 @@ mod tests { | |||
359 | let path = map.path_of(item).unwrap(); | 359 | let path = map.path_of(item).unwrap(); |
360 | format!( | 360 | format!( |
361 | "{}::{} ({})\n", | 361 | "{}::{} ({})\n", |
362 | crate_graph[krate].display_name.as_ref().unwrap(), | 362 | crate_graph[krate].declaration_name.as_ref().unwrap(), |
363 | path, | 363 | path, |
364 | mark | 364 | mark |
365 | ) | 365 | ) |
@@ -400,7 +400,7 @@ mod tests { | |||
400 | .iter() | 400 | .iter() |
401 | .filter_map(|krate| { | 401 | .filter_map(|krate| { |
402 | let cdata = &crate_graph[krate]; | 402 | let cdata = &crate_graph[krate]; |
403 | let name = cdata.display_name.as_ref()?; | 403 | let name = cdata.declaration_name.as_ref()?; |
404 | 404 | ||
405 | let map = db.import_map(krate); | 405 | let map = db.import_map(krate); |
406 | 406 | ||
diff --git a/crates/hir_def/src/nameres.rs b/crates/hir_def/src/nameres.rs index 5e4d73c1f..464ffef21 100644 --- a/crates/hir_def/src/nameres.rs +++ b/crates/hir_def/src/nameres.rs | |||
@@ -173,7 +173,7 @@ impl CrateDefMap { | |||
173 | pub(crate) fn crate_def_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc<CrateDefMap> { | 173 | pub(crate) fn crate_def_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc<CrateDefMap> { |
174 | let _p = profile::span("crate_def_map_query").detail(|| { | 174 | let _p = profile::span("crate_def_map_query").detail(|| { |
175 | db.crate_graph()[krate] | 175 | db.crate_graph()[krate] |
176 | .display_name | 176 | .declaration_name |
177 | .as_ref() | 177 | .as_ref() |
178 | .map(ToString::to_string) | 178 | .map(ToString::to_string) |
179 | .unwrap_or_default() | 179 | .unwrap_or_default() |