mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 05:13:35 +00:00
Remove all upcasts!
It turns out there were a lot redundant too.
This commit is contained in:
parent
a775d21112
commit
8a9a1e3345
80 changed files with 1009 additions and 1257 deletions
|
|
@ -1,6 +1,6 @@
|
|||
//! This module resolves `mod foo;` declaration to file.
|
||||
use arrayvec::ArrayVec;
|
||||
use base_db::{AnchoredPath, RootQueryDb};
|
||||
use base_db::AnchoredPath;
|
||||
use hir_expand::{HirFileIdExt, name::Name};
|
||||
use span::EditionedFileId;
|
||||
|
||||
|
|
@ -77,11 +77,10 @@ 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() };
|
||||
if let Some(file_id) = base_db::Upcast::<dyn RootQueryDb>::upcast(db).resolve_path(path)
|
||||
{
|
||||
if let Some(file_id) = db.resolve_path(path) {
|
||||
let is_mod_rs = candidate.ends_with("/mod.rs");
|
||||
|
||||
let root_dir_owner = is_mod_rs || attr_path.is_some();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue