aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/tests.rs')
-rw-r--r--crates/ra_hir_ty/src/tests.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/tests.rs b/crates/ra_hir_ty/src/tests.rs
index c1744663a..c8461b447 100644
--- a/crates/ra_hir_ty/src/tests.rs
+++ b/crates/ra_hir_ty/src/tests.rs
@@ -4677,7 +4677,7 @@ fn type_at_pos(db: &TestDB, pos: FilePosition) -> String {
4677 4677
4678 let module = db.module_for_file(pos.file_id); 4678 let module = db.module_for_file(pos.file_id);
4679 let crate_def_map = db.crate_def_map(module.krate); 4679 let crate_def_map = db.crate_def_map(module.krate);
4680 for decl in crate_def_map[module.module_id].scope.declarations() { 4680 for decl in crate_def_map[module.local_id].scope.declarations() {
4681 if let ModuleDefId::FunctionId(func) = decl { 4681 if let ModuleDefId::FunctionId(func) = decl {
4682 let (_body, source_map) = db.body_with_source_map(func.into()); 4682 let (_body, source_map) = db.body_with_source_map(func.into());
4683 if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) { 4683 if let Some(expr_id) = source_map.node_expr(Source::new(pos.file_id.into(), &expr)) {
@@ -4753,7 +4753,7 @@ fn infer(content: &str) -> String {
4753 let crate_def_map = db.crate_def_map(module.krate); 4753 let crate_def_map = db.crate_def_map(module.krate);
4754 4754
4755 let mut defs: Vec<DefWithBodyId> = Vec::new(); 4755 let mut defs: Vec<DefWithBodyId> = Vec::new();
4756 visit_module(&db, &crate_def_map, module.module_id, &mut |it| defs.push(it)); 4756 visit_module(&db, &crate_def_map, module.local_id, &mut |it| defs.push(it));
4757 defs.sort_by_key(|def| match def { 4757 defs.sort_by_key(|def| match def {
4758 DefWithBodyId::FunctionId(it) => { 4758 DefWithBodyId::FunctionId(it) => {
4759 it.lookup(&db).ast_id.to_node(&db).syntax().text_range().start() 4759 it.lookup(&db).ast_id.to_node(&db).syntax().text_range().start()
@@ -4796,7 +4796,7 @@ fn visit_module(
4796 } 4796 }
4797 } 4797 }
4798 } 4798 }
4799 ModuleDefId::ModuleId(it) => visit_module(db, crate_def_map, it.module_id, cb), 4799 ModuleDefId::ModuleId(it) => visit_module(db, crate_def_map, it.local_id, cb),
4800 _ => (), 4800 _ => (),
4801 } 4801 }
4802 } 4802 }
@@ -4844,7 +4844,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() {
4844 let events = db.log_executed(|| { 4844 let events = db.log_executed(|| {
4845 let module = db.module_for_file(pos.file_id); 4845 let module = db.module_for_file(pos.file_id);
4846 let crate_def_map = db.crate_def_map(module.krate); 4846 let crate_def_map = db.crate_def_map(module.krate);
4847 visit_module(&db, &crate_def_map, module.module_id, &mut |def| { 4847 visit_module(&db, &crate_def_map, module.local_id, &mut |def| {
4848 db.infer(def); 4848 db.infer(def);
4849 }); 4849 });
4850 }); 4850 });
@@ -4866,7 +4866,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() {
4866 let events = db.log_executed(|| { 4866 let events = db.log_executed(|| {
4867 let module = db.module_for_file(pos.file_id); 4867 let module = db.module_for_file(pos.file_id);
4868 let crate_def_map = db.crate_def_map(module.krate); 4868 let crate_def_map = db.crate_def_map(module.krate);
4869 visit_module(&db, &crate_def_map, module.module_id, &mut |def| { 4869 visit_module(&db, &crate_def_map, module.local_id, &mut |def| {
4870 db.infer(def); 4870 db.infer(def);
4871 }); 4871 });
4872 }); 4872 });