diff options
author | Aleksey Kladov <[email protected]> | 2020-03-13 15:05:46 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-16 16:42:30 +0000 |
commit | 9faea2364dee4fbc9391ad233c570b70256ef002 (patch) | |
tree | 160af959553ce57fdfcbc0a6c79bafcc3611aeea /crates/ra_hir_ty/src/infer/pat.rs | |
parent | 648df02953a6ebf87a5876668eceba208687e8a7 (diff) |
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).
Diffstat (limited to 'crates/ra_hir_ty/src/infer/pat.rs')
-rw-r--r-- | crates/ra_hir_ty/src/infer/pat.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/infer/pat.rs b/crates/ra_hir_ty/src/infer/pat.rs index 7a84e47f8..baed6225b 100644 --- a/crates/ra_hir_ty/src/infer/pat.rs +++ b/crates/ra_hir_ty/src/infer/pat.rs | |||
@@ -12,9 +12,9 @@ use hir_expand::name::Name; | |||
12 | use test_utils::tested_by; | 12 | use test_utils::tested_by; |
13 | 13 | ||
14 | use super::{BindingMode, InferenceContext}; | 14 | use super::{BindingMode, InferenceContext}; |
15 | use crate::{db::HirDatabase, utils::variant_data, Substs, Ty, TypeCtor}; | 15 | use crate::{utils::variant_data, Substs, Ty, TypeCtor}; |
16 | 16 | ||
17 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 17 | impl<'a> InferenceContext<'a> { |
18 | fn infer_tuple_struct_pat( | 18 | fn infer_tuple_struct_pat( |
19 | &mut self, | 19 | &mut self, |
20 | path: Option<&Path>, | 20 | path: Option<&Path>, |
@@ -23,7 +23,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
23 | default_bm: BindingMode, | 23 | default_bm: BindingMode, |
24 | ) -> Ty { | 24 | ) -> Ty { |
25 | let (ty, def) = self.resolve_variant(path); | 25 | let (ty, def) = self.resolve_variant(path); |
26 | let var_data = def.map(|it| variant_data(self.db, it)); | 26 | let var_data = def.map(|it| variant_data(self.db.upcast(), it)); |
27 | self.unify(&ty, expected); | 27 | self.unify(&ty, expected); |
28 | 28 | ||
29 | let substs = ty.substs().unwrap_or_else(Substs::empty); | 29 | let substs = ty.substs().unwrap_or_else(Substs::empty); |
@@ -51,7 +51,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
51 | id: PatId, | 51 | id: PatId, |
52 | ) -> Ty { | 52 | ) -> Ty { |
53 | let (ty, def) = self.resolve_variant(path); | 53 | let (ty, def) = self.resolve_variant(path); |
54 | let var_data = def.map(|it| variant_data(self.db, it)); | 54 | let var_data = def.map(|it| variant_data(self.db.upcast(), it)); |
55 | if let Some(variant) = def { | 55 | if let Some(variant) = def { |
56 | self.write_variant_resolution(id.into(), variant); | 56 | self.write_variant_resolution(id.into(), variant); |
57 | } | 57 | } |