Diffstat (limited to 'tests/common/protocol/value.rs')
| -rw-r--r-- | tests/common/protocol/value.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/common/protocol/value.rs b/tests/common/protocol/value.rs index 038853a..4f1e5c9 100644 --- a/tests/common/protocol/value.rs +++ b/tests/common/protocol/value.rs @@ -1,6 +1,6 @@ use effectful::{ - environment::{Environment, NativeForm}, - bound::{Bool, IsSend, IsSync}, + environment::{Environment, NativeForm, DynBind}, + bound::{Bool, IsSend, IsSync, Dynamic}, effective::Effective, forward_send_sync, }; @@ -25,7 +25,7 @@ mock! { } } -forward_send_sync!({T: (TypeName::MemberType<E>)} {} {E: (Environment)} MockValueVisitor<T, E> where { +forward_send_sync!({} {} {T: (TypeName::MemberType<E>), E: (Environment)} MockValueVisitor<T, E> where { for<'a, 'ctx> TypeName::T<'a, 'ctx, T, E>: Sized }); @@ -35,22 +35,24 @@ any_trait! { ] where T: TypeName::MemberType<E>, for<'a, 'b> TypeName::T<'a, 'b, T, E>: Sized, + for<'a> Dynamic<TypeName::T<'a, 'ctx, T, E>>: DynBind<E>, E: Environment, } impl<'ctx, T: TypeName::MemberType<E>, E: Environment> Value<'ctx, T, E> for MockValueVisitor<T, E> where for<'a, 'lt> TypeName::T<'a, 'lt, T, E>: Sized, + for<'a> Dynamic<TypeName::T<'a, 'ctx, T, E>>: DynBind<E>, { fn visit<'a>( &'a mut self, value: TypeName::T<'a, 'ctx, T, E>, - ) -> NativeForm<'a, VisitResult<TypeName::T<'a, 'ctx, T, E>>, E> + ) -> NativeForm<'a, VisitResult<Dynamic<TypeName::T<'a, 'ctx, T, E>>>, E> where 'ctx: 'a, { E::value(match self.visit(&value) { - VisitResult::Skipped(_) => VisitResult::Skipped(value), + VisitResult::Skipped(_) => VisitResult::Skipped(Dynamic(value)), VisitResult::Control(flow) => VisitResult::Control(flow), }).cast() } @@ -74,6 +76,7 @@ impl<'ctx, U> ValueVisitorExt<'ctx> for U where U: AsVisitor<'ctx, Blocking>, { + #[track_caller] fn visit_value_and_done<'a, T>(&'a mut self, value: T) where T: TypeName::LowerType<'a, 'ctx, Blocking>, @@ -85,6 +88,7 @@ where assert_eq!(result, VisitResult::Control(Flow::Done)); } + #[track_caller] fn visit_value_and_skipped<'a, T>(&'a mut self, value: T) where T: TypeName::LowerType<'a, 'ctx, Blocking>, |