diff options
author | Jonas Schievink <[email protected]> | 2021-01-22 15:31:40 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-01-22 15:33:58 +0000 |
commit | ce29730bc773a27eaeaae7fa4122563df3b253b6 (patch) | |
tree | 57818d6bc1e176a421f63c01a6561fb5e6a291b2 /crates/hir_ty/src/tests.rs | |
parent | a5322e3d5b813e4bce7a73762c14bebbd9a36e01 (diff) |
Obtain `ModuleId`'s `DefMap` through a method
Diffstat (limited to 'crates/hir_ty/src/tests.rs')
-rw-r--r-- | crates/hir_ty/src/tests.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir_ty/src/tests.rs b/crates/hir_ty/src/tests.rs index 4a3fcea8d..25ee664d6 100644 --- a/crates/hir_ty/src/tests.rs +++ b/crates/hir_ty/src/tests.rs | |||
@@ -188,10 +188,10 @@ fn infer_with_mismatches(content: &str, include_mismatches: bool) -> String { | |||
188 | }; | 188 | }; |
189 | 189 | ||
190 | let module = db.module_for_file(file_id); | 190 | let module = db.module_for_file(file_id); |
191 | let crate_def_map = db.crate_def_map(module.krate); | 191 | let def_map = module.def_map(&db); |
192 | 192 | ||
193 | let mut defs: Vec<DefWithBodyId> = Vec::new(); | 193 | let mut defs: Vec<DefWithBodyId> = Vec::new(); |
194 | visit_module(&db, &crate_def_map, module.local_id, &mut |it| defs.push(it)); | 194 | visit_module(&db, &def_map, module.local_id, &mut |it| defs.push(it)); |
195 | defs.sort_by_key(|def| match def { | 195 | defs.sort_by_key(|def| match def { |
196 | DefWithBodyId::FunctionId(it) => { | 196 | DefWithBodyId::FunctionId(it) => { |
197 | let loc = it.lookup(&db); | 197 | let loc = it.lookup(&db); |
@@ -321,7 +321,7 @@ fn typing_whitespace_inside_a_function_should_not_invalidate_types() { | |||
321 | { | 321 | { |
322 | let events = db.log_executed(|| { | 322 | let events = db.log_executed(|| { |
323 | let module = db.module_for_file(pos.file_id); | 323 | let module = db.module_for_file(pos.file_id); |
324 | let crate_def_map = db.crate_def_map(module.krate); | 324 | let crate_def_map = module.def_map(&db); |
325 | visit_module(&db, &crate_def_map, module.local_id, &mut |def| { | 325 | visit_module(&db, &crate_def_map, module.local_id, &mut |def| { |
326 | db.infer(def); | 326 | db.infer(def); |
327 | }); | 327 | }); |