From d5e11b33a36755b139367e1f91a52f5ec27193f6 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 23 Mar 2020 09:59:14 +0200 Subject: [PATCH] Remove the upcast --- crates/ra_hir/src/code_model.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 146e7820e6..9e4aa60227 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -33,7 +33,11 @@ use ra_syntax::{ }; use rustc_hash::FxHashSet; -use crate::{db::HirDatabase, has_source::HasSource, CallableDef, HirDisplay, InFile, Name}; +use crate::{ + db::{DefDatabase, HirDatabase}, + has_source::HasSource, + CallableDef, HirDisplay, InFile, Name, +}; /// hir::Crate describes a single crate. It's the main interface with which /// a crate's dependencies interact. Mostly, it should be just a proxy for the @@ -285,10 +289,10 @@ impl Module { /// this module, if possible. pub fn find_use_path( self, - db: &dyn HirDatabase, + db: &dyn DefDatabase, item: ItemInNs, ) -> Option { - hir_def::find_path::find_path(db.upcast(), item, self.into()) + hir_def::find_path::find_path(db, item, self.into()) } }