From 9faea2364dee4fbc9391ad233c570b70256ef002 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 13 Mar 2020 16:05:46 +0100 Subject: Use `dyn Trait` for working with databse It improves compile time in `--release` mode quite a bit, it doesn't really slow things down and, conceptually, it seems closer to what we want the physical architecture to look like (we don't want to monomorphise EVERYTHING in a single leaf crate). --- crates/ra_hir_ty/src/db.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir_ty/src/db.rs') diff --git a/crates/ra_hir_ty/src/db.rs b/crates/ra_hir_ty/src/db.rs index 74b309005..11fc2ac3d 100644 --- a/crates/ra_hir_ty/src/db.rs +++ b/crates/ra_hir_ty/src/db.rs @@ -7,7 +7,7 @@ use hir_def::{ VariantId, }; use ra_arena::map::ArenaMap; -use ra_db::{impl_intern_key, salsa, CrateId}; +use ra_db::{impl_intern_key, salsa, CrateId, Upcast}; use ra_prof::profile; use crate::{ @@ -20,7 +20,7 @@ use hir_expand::name::Name; #[salsa::query_group(HirDatabaseStorage)] #[salsa::requires(salsa::Database)] -pub trait HirDatabase: DefDatabase { +pub trait HirDatabase: DefDatabase + Upcast { #[salsa::invoke(infer_wait)] fn infer(&self, def: DefWithBodyId) -> Arc; -- cgit v1.2.3