aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/item_tree.rs6
-rw-r--r--crates/ra_hir_def/src/nameres/tests/mod_resolution.rs7
2 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/item_tree.rs b/crates/ra_hir_def/src/item_tree.rs
index 71b415802..245ee5e62 100644
--- a/crates/ra_hir_def/src/item_tree.rs
+++ b/crates/ra_hir_def/src/item_tree.rs
@@ -8,6 +8,7 @@ use hir_expand::{
8}; 8};
9use ra_arena::{Arena, Idx, RawId}; 9use ra_arena::{Arena, Idx, RawId};
10use ra_syntax::{ast, match_ast}; 10use ra_syntax::{ast, match_ast};
11use test_utils::mark;
11 12
12use crate::{ 13use crate::{
13 attr::Attrs, 14 attr::Attrs,
@@ -693,7 +694,10 @@ impl Ctx {
693 .flat_map(|items| items.0) 694 .flat_map(|items| items.0)
694 .collect() 695 .collect()
695 }) 696 })
696 .unwrap_or_default(), 697 .unwrap_or_else(|| {
698 mark::hit!(name_res_works_for_broken_modules);
699 Vec::new()
700 }),
697 } 701 }
698 }; 702 };
699 let ast_id = self.source_ast_id_map.ast_id(module); 703 let ast_id = self.source_ast_id_map.ast_id(module);
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 b43b294ca..d42933eed 100644
--- a/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
+++ b/crates/ra_hir_def/src/nameres/tests/mod_resolution.rs
@@ -20,8 +20,11 @@ fn name_res_works_for_broken_modules() {
20 ", 20 ",
21 ); 21 );
22 assert_snapshot!(map, @r###" 22 assert_snapshot!(map, @r###"
23 ⋮crate 23crate
24 ⋮Baz: _ 24Baz: _
25foo: t
26
27crate::foo
25 "###); 28 "###);
26} 29}
27 30