Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres/mod_resolution.rs')
| -rw-r--r-- | crates/hir-def/src/nameres/mod_resolution.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/hir-def/src/nameres/mod_resolution.rs b/crates/hir-def/src/nameres/mod_resolution.rs index 17d09bcbd0..d6c9f5a00c 100644 --- a/crates/hir-def/src/nameres/mod_resolution.rs +++ b/crates/hir-def/src/nameres/mod_resolution.rs @@ -1,10 +1,9 @@ //! This module resolves `mod foo;` declaration to file. use arrayvec::ArrayVec; use base_db::AnchoredPath; -use hir_expand::{name::Name, HirFileIdExt}; -use span::EditionedFileId; +use hir_expand::{EditionedFileId, name::Name}; -use crate::{db::DefDatabase, HirFileId}; +use crate::{HirFileId, db::DefDatabase}; const MOD_DEPTH_LIMIT: usize = 32; @@ -77,9 +76,9 @@ impl ModDir { } }; - let orig_file_id = file_id.original_file_respecting_includes(db.upcast()); + let orig_file_id = file_id.original_file_respecting_includes(db); for candidate in candidate_files.iter() { - let path = AnchoredPath { anchor: orig_file_id.file_id(), path: candidate.as_str() }; + let path = AnchoredPath { anchor: orig_file_id.file_id(db), path: candidate.as_str() }; if let Some(file_id) = db.resolve_path(path) { let is_mod_rs = candidate.ends_with("/mod.rs"); @@ -92,7 +91,7 @@ impl ModDir { if let Some(mod_dir) = self.child(dir_path, !root_dir_owner) { return Ok(( // FIXME: Edition, is this rightr? - EditionedFileId::new(file_id, orig_file_id.edition()), + EditionedFileId::new(db, file_id, orig_file_id.edition(db)), is_mod_rs, mod_dir, )); |