aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r--crates/ra_hir_def/src/nameres/collector.rs5
-rw-r--r--crates/ra_hir_def/src/nameres/tests/incremental.rs6
-rw-r--r--crates/ra_hir_def/src/nameres/tests/mod_resolution.rs2
3 files changed, 7 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs
index 37d0f3093..5c899aff3 100644
--- a/crates/ra_hir_def/src/nameres/collector.rs
+++ b/crates/ra_hir_def/src/nameres/collector.rs
@@ -664,7 +664,8 @@ where
664 let name = def.name.clone(); 664 let name = def.name.clone();
665 let def: PerNs = match def.kind { 665 let def: PerNs = match def.kind {
666 raw::DefKind::Function(ast_id) => { 666 raw::DefKind::Function(ast_id) => {
667 PerNs::values(FunctionId::from_ast_id(ctx, ast_id).into()) 667 let f = FunctionId::from_ast_id(ctx, ast_id);
668 PerNs::values(f.into())
668 } 669 }
669 raw::DefKind::Struct(ast_id) => { 670 raw::DefKind::Struct(ast_id) => {
670 let id = StructOrUnionId::from_ast_id(ctx, ast_id).into(); 671 let id = StructOrUnionId::from_ast_id(ctx, ast_id).into();
@@ -798,7 +799,7 @@ mod tests {
798 799
799 fn do_limited_resolve(code: &str, limit: u32, poison_limit: u32) -> CrateDefMap { 800 fn do_limited_resolve(code: &str, limit: u32, poison_limit: u32) -> CrateDefMap {
800 let (db, _file_id) = TestDB::with_single_file(&code); 801 let (db, _file_id) = TestDB::with_single_file(&code);
801 let krate = db.crate_graph().iter().next().unwrap(); 802 let krate = db.test_crate();
802 803
803 let def_map = { 804 let def_map = {
804 let edition = db.crate_graph().edition(krate); 805 let edition = db.crate_graph().edition(krate);
diff --git a/crates/ra_hir_def/src/nameres/tests/incremental.rs b/crates/ra_hir_def/src/nameres/tests/incremental.rs
index 80dcec62f..903a22771 100644
--- a/crates/ra_hir_def/src/nameres/tests/incremental.rs
+++ b/crates/ra_hir_def/src/nameres/tests/incremental.rs
@@ -1,12 +1,12 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_db::{SourceDatabase, SourceDatabaseExt}; 3use ra_db::SourceDatabaseExt;
4 4
5use super::*; 5use super::*;
6 6
7fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) { 7fn check_def_map_is_not_recomputed(initial: &str, file_change: &str) {
8 let (mut db, pos) = TestDB::with_position(initial); 8 let (mut db, pos) = TestDB::with_position(initial);
9 let krate = db.crate_graph().iter().next().unwrap(); 9 let krate = db.test_crate();
10 { 10 {
11 let events = db.log_executed(|| { 11 let events = db.log_executed(|| {
12 db.crate_def_map(krate); 12 db.crate_def_map(krate);
@@ -111,7 +111,7 @@ fn typing_inside_a_macro_should_not_invalidate_def_map() {
111 m!(X); 111 m!(X);
112 ", 112 ",
113 ); 113 );
114 let krate = db.crate_graph().iter().next().unwrap(); 114 let krate = db.test_crate();
115 { 115 {
116 let events = db.log_executed(|| { 116 let events = db.log_executed(|| {
117 let crate_def_map = db.crate_def_map(krate); 117 let crate_def_map = db.crate_def_map(krate);
diff --git a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
index dee364a14..eb7b85c07 100644
--- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
+++ b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
@@ -656,7 +656,7 @@ fn unresolved_module_diagnostics() {
656 //- /foo.rs 656 //- /foo.rs
657 ", 657 ",
658 ); 658 );
659 let krate = db.crate_graph().iter().next().unwrap(); 659 let krate = db.test_crate();
660 660
661 let crate_def_map = db.crate_def_map(krate); 661 let crate_def_map = db.crate_def_map(krate);
662 662