From dbf9820e35cf2d96bd3295e6890e8ef1cb0a060a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 3 Feb 2019 22:15:31 +0300 Subject: make HirDatabase object-safe --- crates/ra_hir/src/db.rs | 5 +++++ crates/ra_hir/src/mock.rs | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') 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 { #[salsa::invoke(crate::ty::method_resolution::CrateImplBlocks::impls_in_crate_query)] fn impls_in_crate(&self, krate: Crate) -> Arc; } + +#[test] +fn hir_database_is_object_safe() { + fn _assert_object_safe(_: &dyn HirDatabase) {} +} 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}; use parking_lot::Mutex; use ra_db::{ - CheckCanceled, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa, + FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa, }; use relative_path::RelativePathBuf; use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; @@ -159,8 +159,6 @@ impl salsa::ParallelDatabase for MockDatabase { } } -impl CheckCanceled for MockDatabase {} - impl AsRef for MockDatabase { fn as_ref(&self) -> &HirInterner { &self.interner -- cgit v1.2.3