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_def/src/docs.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_def/src/docs.rs')
-rw-r--r-- | crates/ra_hir_def/src/docs.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/docs.rs b/crates/ra_hir_def/src/docs.rs index b29f142e3..0539a77d4 100644 --- a/crates/ra_hir_def/src/docs.rs +++ b/crates/ra_hir_def/src/docs.rs | |||
@@ -34,7 +34,7 @@ impl Documentation { | |||
34 | } | 34 | } |
35 | 35 | ||
36 | pub(crate) fn documentation_query( | 36 | pub(crate) fn documentation_query( |
37 | db: &impl DefDatabase, | 37 | db: &dyn DefDatabase, |
38 | def: AttrDefId, | 38 | def: AttrDefId, |
39 | ) -> Option<Documentation> { | 39 | ) -> Option<Documentation> { |
40 | match def { | 40 | match def { |
@@ -60,7 +60,7 @@ impl Documentation { | |||
60 | docs_from_ast(&src.value[it.local_id]) | 60 | docs_from_ast(&src.value[it.local_id]) |
61 | } | 61 | } |
62 | AttrDefId::TraitId(it) => docs_from_ast(&it.lookup(db).source(db).value), | 62 | AttrDefId::TraitId(it) => docs_from_ast(&it.lookup(db).source(db).value), |
63 | AttrDefId::MacroDefId(it) => docs_from_ast(&it.ast_id?.to_node(db)), | 63 | AttrDefId::MacroDefId(it) => docs_from_ast(&it.ast_id?.to_node(db.upcast())), |
64 | AttrDefId::ConstId(it) => docs_from_ast(&it.lookup(db).source(db).value), | 64 | AttrDefId::ConstId(it) => docs_from_ast(&it.lookup(db).source(db).value), |
65 | AttrDefId::StaticId(it) => docs_from_ast(&it.lookup(db).source(db).value), | 65 | AttrDefId::StaticId(it) => docs_from_ast(&it.lookup(db).source(db).value), |
66 | AttrDefId::FunctionId(it) => docs_from_ast(&it.lookup(db).source(db).value), | 66 | AttrDefId::FunctionId(it) => docs_from_ast(&it.lookup(db).source(db).value), |