aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/mod_resolution.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres/mod_resolution.rs')
-rw-r--r--crates/ra_hir/src/nameres/mod_resolution.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_hir/src/nameres/mod_resolution.rs b/crates/ra_hir/src/nameres/mod_resolution.rs
index a9e9eb9e6..3aa32bd66 100644
--- a/crates/ra_hir/src/nameres/mod_resolution.rs
+++ b/crates/ra_hir/src/nameres/mod_resolution.rs
@@ -23,6 +23,7 @@ impl<'a> ParentModule<'a> {
23pub(super) fn resolve_submodule( 23pub(super) fn resolve_submodule(
24 db: &impl DefDatabase, 24 db: &impl DefDatabase,
25 file_id: HirFileId, 25 file_id: HirFileId,
26 mod_attr_path: Option<&SmolStr>,
26 name: &Name, 27 name: &Name,
27 is_root: bool, 28 is_root: bool,
28 attr_path: Option<&SmolStr>, 29 attr_path: Option<&SmolStr>,
@@ -80,7 +81,7 @@ pub(super) fn resolve_submodule(
80 ResolutionMode::OutOfLine(OutOfLineMode::WithAttributePath(path)) 81 ResolutionMode::OutOfLine(OutOfLineMode::WithAttributePath(path))
81 } 82 }
82 (None, None) => { 83 (None, None) => {
83 let is_dir_owner = is_root || mod_name == "mod"; 84 let is_dir_owner = is_root || mod_name == "mod" || mod_attr_path.is_some();
84 if is_dir_owner { 85 if is_dir_owner {
85 let file_mod = dir_path.join(format!("{}.rs", name)); 86 let file_mod = dir_path.join(format!("{}.rs", name));
86 let dir_mod = dir_path.join(format!("{}/mod.rs", name)); 87 let dir_mod = dir_path.join(format!("{}/mod.rs", name));