aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-03 19:15:56 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-03 19:15:56 +0000
commit998ed13d09992d1fe24a45cc725c55390d9a5ca7 (patch)
tree0b2388011e628c6a1ff6d7cbca0664ba00dfe4f5 /crates/ra_hir
parent395965351d467c716f259935557117fe42a8c9f4 (diff)
parentdbf9820e35cf2d96bd3295e6890e8ef1cb0a060a (diff)
Merge #735
735: make HirDatabase object-safe r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/db.rs5
-rw-r--r--crates/ra_hir/src/mock.rs4
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]
108fn 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
3use parking_lot::Mutex; 3use parking_lot::Mutex;
4use ra_db::{ 4use ra_db::{
5 CheckCanceled, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa, 5 FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa,
6}; 6};
7use relative_path::RelativePathBuf; 7use relative_path::RelativePathBuf;
8use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; 8use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset};
@@ -159,8 +159,6 @@ impl salsa::ParallelDatabase for MockDatabase {
159 } 159 }
160} 160}
161 161
162impl CheckCanceled for MockDatabase {}
163
164impl AsRef<HirInterner> for MockDatabase { 162impl AsRef<HirInterner> for MockDatabase {
165 fn as_ref(&self) -> &HirInterner { 163 fn as_ref(&self) -> &HirInterner {
166 &self.interner 164 &self.interner