diff options
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r-- | crates/ra_hir/src/nameres/tests.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index 3d420467c..9c5ca097e 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs | |||
@@ -16,7 +16,7 @@ fn item_map(fixture: &str) -> (Arc<ItemMap>, ModuleId) { | |||
16 | let module = crate::source_binder::module_from_position(&db, pos).unwrap(); | 16 | let module = crate::source_binder::module_from_position(&db, pos).unwrap(); |
17 | let krate = module.krate(&db).unwrap(); | 17 | let krate = module.krate(&db).unwrap(); |
18 | let module_id = module.module_id; | 18 | let module_id = module.module_id; |
19 | (db.item_map(krate.crate_id), module_id) | 19 | (db.item_map(krate), module_id) |
20 | } | 20 | } |
21 | 21 | ||
22 | /// Sets the crate root to the file of the cursor marker | 22 | /// Sets the crate root to the file of the cursor marker |
@@ -30,7 +30,7 @@ fn item_map_custom_crate_root(fixture: &str) -> (Arc<ItemMap>, ModuleId) { | |||
30 | let module = crate::source_binder::module_from_position(&db, pos).unwrap(); | 30 | let module = crate::source_binder::module_from_position(&db, pos).unwrap(); |
31 | let krate = module.krate(&db).unwrap(); | 31 | let krate = module.krate(&db).unwrap(); |
32 | let module_id = module.module_id; | 32 | let module_id = module.module_id; |
33 | (db.item_map(krate.crate_id), module_id) | 33 | (db.item_map(krate), module_id) |
34 | } | 34 | } |
35 | 35 | ||
36 | fn check_module_item_map(map: &ItemMap, module_id: ModuleId, expected: &str) { | 36 | fn check_module_item_map(map: &ItemMap, module_id: ModuleId, expected: &str) { |
@@ -297,7 +297,7 @@ fn item_map_across_crates() { | |||
297 | 297 | ||
298 | let module = crate::source_binder::module_from_file_id(&db, main_id).unwrap(); | 298 | let module = crate::source_binder::module_from_file_id(&db, main_id).unwrap(); |
299 | let krate = module.krate(&db).unwrap(); | 299 | let krate = module.krate(&db).unwrap(); |
300 | let item_map = db.item_map(krate.crate_id); | 300 | let item_map = db.item_map(krate); |
301 | 301 | ||
302 | check_module_item_map( | 302 | check_module_item_map( |
303 | &item_map, | 303 | &item_map, |
@@ -349,7 +349,7 @@ fn import_across_source_roots() { | |||
349 | 349 | ||
350 | let module = crate::source_binder::module_from_file_id(&db, main_id).unwrap(); | 350 | let module = crate::source_binder::module_from_file_id(&db, main_id).unwrap(); |
351 | let krate = module.krate(&db).unwrap(); | 351 | let krate = module.krate(&db).unwrap(); |
352 | let item_map = db.item_map(krate.crate_id); | 352 | let item_map = db.item_map(krate); |
353 | 353 | ||
354 | check_module_item_map( | 354 | check_module_item_map( |
355 | &item_map, | 355 | &item_map, |
@@ -391,7 +391,7 @@ fn reexport_across_crates() { | |||
391 | 391 | ||
392 | let module = crate::source_binder::module_from_file_id(&db, main_id).unwrap(); | 392 | let module = crate::source_binder::module_from_file_id(&db, main_id).unwrap(); |
393 | let krate = module.krate(&db).unwrap(); | 393 | let krate = module.krate(&db).unwrap(); |
394 | let item_map = db.item_map(krate.crate_id); | 394 | let item_map = db.item_map(krate); |
395 | 395 | ||
396 | check_module_item_map( | 396 | check_module_item_map( |
397 | &item_map, | 397 | &item_map, |
@@ -409,7 +409,7 @@ fn check_item_map_is_not_recomputed(initial: &str, file_change: &str) { | |||
409 | let krate = module.krate(&db).unwrap(); | 409 | let krate = module.krate(&db).unwrap(); |
410 | { | 410 | { |
411 | let events = db.log_executed(|| { | 411 | let events = db.log_executed(|| { |
412 | db.item_map(krate.crate_id); | 412 | db.item_map(krate); |
413 | }); | 413 | }); |
414 | assert!(format!("{:?}", events).contains("item_map")) | 414 | assert!(format!("{:?}", events).contains("item_map")) |
415 | } | 415 | } |
@@ -417,7 +417,7 @@ fn check_item_map_is_not_recomputed(initial: &str, file_change: &str) { | |||
417 | 417 | ||
418 | { | 418 | { |
419 | let events = db.log_executed(|| { | 419 | let events = db.log_executed(|| { |
420 | db.item_map(krate.crate_id); | 420 | db.item_map(krate); |
421 | }); | 421 | }); |
422 | assert!( | 422 | assert!( |
423 | !format!("{:?}", events).contains("item_map"), | 423 | !format!("{:?}", events).contains("item_map"), |