Diffstat (limited to 'tests/common/builder.rs')
| -rw-r--r-- | tests/common/builder.rs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/common/builder.rs b/tests/common/builder.rs index 49f7d16..419661b 100644 --- a/tests/common/builder.rs +++ b/tests/common/builder.rs @@ -1,8 +1,9 @@ use core::fmt::{Debug, Display}; use effectful::{ - bound::{Bool, Dynamic, DynamicShim, IsSend, IsSync}, - effective::Effective, - environment::{DynBind, Environment, NativeForm}, + DynBind, + bound::{Bool, Dynamic, IsSend, IsSync}, + effective::{Effective, Canonical}, + environment::{Environment}, forward_send_sync, SendSync, }; use mockall::mock; @@ -36,11 +37,11 @@ mock! { // pub fn traits(&self, id: WithLtTypeId<'_, '_>) -> &Option<Box<DynamicShim<dyn for<'ctx> AnyTrait<'ctx, E>>>>; // pub fn traits_mut(&mut self, id: WithLtTypeId<'_, '_>) -> &mut Option<Box<DynamicShim<dyn for<'ctx> AnyTrait<'ctx, E>>>>; - pub fn traits_mut(&mut self) -> &mut Box<dyn for<'a, 'ctx> FnMut(WithLtTypeId<'a, 'ctx>) -> Option<MutAnyUnsized<'a, 'a, 'ctx>>>; + pub fn traits_mut(&mut self) -> &mut Box<dyn for<'a, 'ctx> FnMut(WithLtTypeId<'a, 'ctx>) -> Option<MutAnyUnsized<'a, 'a, 'ctx>> + Send>; } } -forward_send_sync!({Seed: ('static), Error: ('static)} {} {Value: ('static), E: (Environment)} MockBuilder<Seed, Value, Error, E>); +forward_send_sync!({Seed: ('static), Error: ('static)} {} {Value: ('static + Send), E: (Environment + Send)} MockBuilder<Seed, Value, Error, E>); impl<Seed, Value, Error: Display + Debug, E: Environment> BuilderTypes<E> for MockBuilder<Seed, Value, Error, E> @@ -78,19 +79,19 @@ impl<Seed: 'static, Value: 'static, Error: 'static, E: Environment> } } -impl<'ctx, Seed: DynBind<E>, Value, Error: DynBind<E> + Display + Debug, E: Environment> +impl<'ctx, Seed: DynBind<E>, Value: Send, Error: DynBind<E> + Display + Debug, E: Environment + Send> Builder<'ctx, E> for MockBuilder<Seed, Value, Error, E> where Dynamic<Value>: DynBind<E>, { - fn from_seed<'a>(seed: Self::Seed) -> NativeForm<'a, Self, E> + fn from_seed<'a>(seed: Self::Seed) -> Canonical<'a, Self, E> where Self: 'a, { E::value(Self::from_seed(seed)).cast() } - fn build<'a>(self) -> NativeForm<'a, Result<Self::Output, Self::Error>, E> + fn build<'a>(self) -> Canonical<'a, Result<Self::Output, Self::Error>, E> where Self: 'a, { @@ -98,7 +99,7 @@ where } } -impl<'ctx, Seed, Value, Error: Display + Debug, E: Environment> AsVisitor<'ctx, E> +impl<'ctx, Seed, Value: Send, Error: Display + Debug, E: Environment + Send> AsVisitor<'ctx, E> for MockBuilder<Seed, Value, Error, E> where Seed: DynBind<E>, |