Diffstat (limited to 'src/protocol/walker/hint.rs')
-rw-r--r--src/protocol/walker/hint.rs18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/protocol/walker/hint.rs b/src/protocol/walker/hint.rs
index 2084b5b..5d1dee9 100644
--- a/src/protocol/walker/hint.rs
+++ b/src/protocol/walker/hint.rs
@@ -10,7 +10,7 @@ use effectful::{
bound::{IsSend, IsSync},
effective::Effective,
environment::{DynBind, EnvConfig, Environment, NativeForm},
- higher_ranked::Mut,
+ higher_ranked::Mut, SendSync,
};
use crate::{
@@ -24,7 +24,7 @@ use crate::{
pub mod Meta {
use effectful::environment::{DynBind, EnvConfig};
- pub trait MemberTypeForLt<'a, 'ctx: 'a, E: EnvConfig, B> {
+ pub trait MemberTypeForLt<'a, 'ctx: 'a, E: EnvConfig, B>: DynBind<E> {
type T: ?Sized + LowerTypeWithBound<'a, 'ctx, E, &'a &'ctx (), Higher = Self>;
}
@@ -68,7 +68,7 @@ impl<'a, 'ctx: 'a, E: EnvConfig> Meta::LowerTypeWithBound<'a, 'ctx, E, &'a &'ctx
/// Meta information for the hint.
///
/// This gives the visitor more information to work from when selecting a hint.
-pub trait HintMeta: TypeName::MemberType<Self::Effect> + 'static {
+pub trait HintMeta: Send + Sync + TypeName::MemberType<Self::Effect> + 'static {
/// Information known by the walker.
///
/// This should be information easy to get without changing the state of the walker
@@ -106,21 +106,12 @@ pub trait Hint<'ctx, Protocol: ?Sized + HintMeta>: DynBind<Protocol::Effect> {
) -> NativeForm<'a, Result<MetaKnown<'a, 'ctx, Protocol>, ()>, Protocol::Effect>;
}
+#[derive(SendSync)]
pub struct DynVisitorWith<'temp, 'ctx, Protocol: ?Sized + HintMeta> {
visitor: DynVisitor<'temp, 'ctx, Protocol::Effect>,
_marker: Marker<Protocol>,
}
-unsafe impl<'a, 'ctx, P: HintMeta> IsSend<<P::Effect as EnvConfig>::NeedSend>
- for DynVisitorWith<'a, 'ctx, P>
-{
-}
-
-unsafe impl<'a, 'ctx, P: HintMeta> IsSync<<P::Effect as EnvConfig>::NeedSync>
- for DynVisitorWith<'a, 'ctx, P>
-{
-}
-
pub trait HasProtocol<Protocol: ?Sized> {}
impl<'temp, 'ctx: 'temp, Protocol: ?Sized + HintMeta> DynVisitorWith<'temp, 'ctx, Protocol> {
@@ -157,6 +148,7 @@ impl<'temp, 'ctx, Protocol: ?Sized + HintMeta> DerefMut for DynVisitorWith<'temp
}
}
+#[derive(SendSync)]
pub struct HintProto<Protocol: ?Sized>(Marker<Protocol>);
impl<'a, 'ctx, Protocol: ?Sized> TypeName::MemberTypeForLt<'a, 'ctx, Protocol::Effect, &'a &'ctx ()>