diff options
author | Aleksey Kladov <[email protected]> | 2019-02-03 19:15:31 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-03 19:15:31 +0000 |
commit | dbf9820e35cf2d96bd3295e6890e8ef1cb0a060a (patch) | |
tree | 0b2388011e628c6a1ff6d7cbca0664ba00dfe4f5 /crates/ra_hir/src | |
parent | 395965351d467c716f259935557117fe42a8c9f4 (diff) |
make HirDatabase object-safe
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/db.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir/src/mock.rs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index 6b21fe744..e03632519 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs | |||
@@ -103,3 +103,8 @@ pub trait HirDatabase: PersistentHirDatabase { | |||
103 | #[salsa::invoke(crate::ty::method_resolution::CrateImplBlocks::impls_in_crate_query)] | 103 | #[salsa::invoke(crate::ty::method_resolution::CrateImplBlocks::impls_in_crate_query)] |
104 | fn impls_in_crate(&self, krate: Crate) -> Arc<CrateImplBlocks>; | 104 | fn impls_in_crate(&self, krate: Crate) -> Arc<CrateImplBlocks>; |
105 | } | 105 | } |
106 | |||
107 | #[test] | ||
108 | fn hir_database_is_object_safe() { | ||
109 | fn _assert_object_safe(_: &dyn HirDatabase) {} | ||
110 | } | ||
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index 17bdd48c6..00a07d1a1 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs | |||
@@ -2,7 +2,7 @@ use std::{sync::Arc, panic}; | |||
2 | 2 | ||
3 | use parking_lot::Mutex; | 3 | use parking_lot::Mutex; |
4 | use ra_db::{ | 4 | use ra_db::{ |
5 | CheckCanceled, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa, | 5 | FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa, |
6 | }; | 6 | }; |
7 | use relative_path::RelativePathBuf; | 7 | use relative_path::RelativePathBuf; |
8 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; | 8 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; |
@@ -159,8 +159,6 @@ impl salsa::ParallelDatabase for MockDatabase { | |||
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | impl CheckCanceled for MockDatabase {} | ||
163 | |||
164 | impl AsRef<HirInterner> for MockDatabase { | 162 | impl AsRef<HirInterner> for MockDatabase { |
165 | fn as_ref(&self) -> &HirInterner { | 163 | fn as_ref(&self) -> &HirInterner { |
166 | &self.interner | 164 | &self.interner |