Diffstat (limited to 'tests/common/protocol/value.rs')
| -rw-r--r-- | tests/common/protocol/value.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/common/protocol/value.rs b/tests/common/protocol/value.rs index 6897a94..a3f4dbb 100644 --- a/tests/common/protocol/value.rs +++ b/tests/common/protocol/value.rs @@ -1,7 +1,9 @@ use effectful::{ bound::{Bool, Dynamic, IsSend, IsSync}, - effective::Effective, - environment::{DynBind, Environment, NativeForm}, + effective::{Effective, Canonical}, + environment::{ Environment}, + DynBind, + blocking::BlockingSpin, forward_send_sync, }; use mockall::mock; @@ -14,8 +16,6 @@ use treaty::{ Flow, }; -use crate::common::Blocking; - mock! { pub ValueVisitor<T: type_name::Static> where @@ -25,7 +25,7 @@ mock! { } } -forward_send_sync!({} {} {T: (type_name::Static)} MockValueVisitor<T> where { +forward_send_sync!({} {} {T: (type_name::Static + Send)} MockValueVisitor<T> where { for<'a, 'ctx> type_name::Lowered<'a, 'ctx, T>: Sized }); @@ -39,14 +39,14 @@ forward_send_sync!({} {} {T: (type_name::Static)} MockValueVisitor<T> where { // E: Environment, // } -impl<'ctx, T: type_name::Static, E: Environment> Value<'ctx, T, E> for MockValueVisitor<T> +impl<'ctx, T: type_name::Static + Send, E: Environment> Value<'ctx, T, E> for MockValueVisitor<T> where for<'a, 'b> type_name::Lowered<'a, 'b, T>: Sized, { fn visit<'this: 'value, 'value: 'e, 'e>( &'this mut self, value: type_name::Lowered<'value, 'ctx, T>, - ) -> NativeForm<'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, T>>>, E> + ) -> Canonical<'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, T>>>, E> where // type_name::Lowered<'value, 'ctx, T>: Sized, Dynamic<type_name::Lowered<'value, 'ctx, T>>: DynBind<E>, @@ -58,7 +58,7 @@ where // fn visit<'a>( // &'a mut self, // value: TypeName::T<'a, 'ctx, T, E>, - // ) -> NativeForm<'a, VisitResult<Dynamic<TypeName::T<'a, 'ctx, T, E>>>, E> + // ) -> Canonical<'a, VisitResult<Dynamic<TypeName::T<'a, 'ctx, T, E>>>, E> // where // 'ctx: 'a, // { @@ -86,7 +86,7 @@ pub trait ValueVisitorExt<'ctx> { impl<'ctx, U> ValueVisitorExt<'ctx> for U where - U: AsVisitor<'ctx, Blocking>, + U: AsVisitor<'ctx, BlockingSpin>, { #[track_caller] fn visit_value_and_done<'a, T>(&'a mut self, value: T) @@ -95,7 +95,7 @@ where type_name::Raised<'a, 'ctx, T>: type_name::Static, 'ctx: 'a, { - let result = visit_value::<_, Blocking>(self.as_visitor(), value).into_value(); + let result = visit_value::<_, BlockingSpin>(self.as_visitor(), value).wait(); assert_eq!(result, VisitResult::Control(Flow::Done)); } @@ -113,11 +113,11 @@ where // #[track_caller] // fn visit_value_and_done<'a, T>(&'a mut self, value: T) // where - // T: TypeName::LowerType<'a, 'ctx, Blocking>, - // TypeName::HigherRanked<'a, 'ctx, T, Blocking>: TypeName::MemberType<Blocking>, + // T: TypeName::LowerType<'a, 'ctx, BlockingSpin>, + // TypeName::HigherRanked<'a, 'ctx, T, BlockingSpin>: TypeName::MemberType<BlockingSpin>, // 'ctx: 'a, // { - // let result = visit_value::<_, Blocking>(self.as_visitor(), value).into_value(); + // let result = visit_value::<_, BlockingSpin>(self.as_visitor(), value).into_value(); // // assert_eq!(result, VisitResult::Control(Flow::Done)); // } @@ -125,11 +125,11 @@ where // #[track_caller] // fn visit_value_and_skipped<'a, T>(&'a mut self, value: T) // where - // T: TypeName::LowerType<'a, 'ctx, Blocking>, - // TypeName::HigherRanked<'a, 'ctx, T, Blocking>: TypeName::MemberType<Blocking>, + // T: TypeName::LowerType<'a, 'ctx, BlockingSpin>, + // TypeName::HigherRanked<'a, 'ctx, T, BlockingSpin>: TypeName::MemberType<BlockingSpin>, // 'ctx: 'a, // { - // let result = visit_value::<_, Blocking>(self.as_visitor(), value).into_value(); + // let result = visit_value::<_, BlockingSpin>(self.as_visitor(), value).into_value(); // // assert_eq!(result.unit_skipped(), VisitResult::Skipped(())); // } |