diff options
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r-- | crates/ra_hir/src/nameres/mod_resolution.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_hir/src/nameres/mod_resolution.rs b/crates/ra_hir/src/nameres/mod_resolution.rs index 94c9946ff..c6be93dcd 100644 --- a/crates/ra_hir/src/nameres/mod_resolution.rs +++ b/crates/ra_hir/src/nameres/mod_resolution.rs | |||
@@ -1,3 +1,5 @@ | |||
1 | //! This module resolves `mod foo;` declaration to file. | ||
2 | |||
1 | use std::{borrow::Cow, sync::Arc}; | 3 | use std::{borrow::Cow, sync::Arc}; |
2 | 4 | ||
3 | use ra_db::{FileId, SourceRoot}; | 5 | use ra_db::{FileId, SourceRoot}; |
@@ -77,7 +79,7 @@ pub(super) fn resolve_submodule( | |||
77 | let path = dir_path.join(file_path.as_ref()).normalize(); | 79 | let path = dir_path.join(file_path.as_ref()).normalize(); |
78 | ResolutionMode::OutOfLine(OutOfLineMode::WithAttributePath(path)) | 80 | ResolutionMode::OutOfLine(OutOfLineMode::WithAttributePath(path)) |
79 | } | 81 | } |
80 | _ => { | 82 | (None, None) => { |
81 | let is_dir_owner = is_root || mod_name == "mod"; | 83 | let is_dir_owner = is_root || mod_name == "mod"; |
82 | if is_dir_owner { | 84 | if is_dir_owner { |
83 | let file_mod = dir_path.join(format!("{}.rs", name)); | 85 | let file_mod = dir_path.join(format!("{}.rs", name)); |