Diffstat (limited to 'src/protocol/visitor/value.rs')
| -rw-r--r-- | src/protocol/visitor/value.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/protocol/visitor/value.rs b/src/protocol/visitor/value.rs index d8461f5..320d1ae 100644 --- a/src/protocol/visitor/value.rs +++ b/src/protocol/visitor/value.rs @@ -11,7 +11,7 @@ use crate::{ /// Trait object for the [`Value`] protocol. /// /// Types implementing the [`Value`] protocol will implement this trait. -pub trait Value<'a, T, E: Effect = SyncEffect> { +pub trait Value<'a, 'ctx: 'a, T, E: Effect<'ctx> = SyncEffect> { /// Visit a value of type `T`. /// /// Use this to give a value to a visitor. Its expected that a walker @@ -21,28 +21,28 @@ pub trait Value<'a, T, E: Effect = SyncEffect> { /// If a [`ControlFlow::Break`] is returned then the walker /// should stop walking as soon as possible as there has likely been /// and error. - fn visit(&'a mut self, value: T) -> ControlFlowFor<'a, E>; + fn visit(&'a mut self, value: T) -> ControlFlowFor<'a, 'ctx, E>; } nameable! { - pub struct Name['a, 'ctx, T, E]; + pub struct Name['a, 'ctx: 'a, T, E]; - impl [T::Name, E] for dyn Value<'a, T, E> + 'a where { + impl [T::Name, E] for dyn Value<'a, 'ctx, T, E> + 'a where { T: TypeNameable<'a, 'ctx> + ?Sized, - E: Effect + 'static, + E: Effect<'ctx>, } - impl [T, E] where dyn Value<'a, T::Nameable, E> + 'a { + impl [T, E] where dyn Value<'a, 'ctx, T::Nameable, E> + 'a { T: TypeName<'a, 'ctx> + ?Sized, - E: Effect + 'static, + E: Effect<'ctx>, } } // This enrolls the Value protocol into the walker hint system. -impl<'ctx, T, E: Effect> HintMeta<'ctx> for dyn Value<'_, T, E> + '_ { - type Known<'a> = () where 'ctx: 'a; +impl<'a, 'ctx: 'a, T, E: Effect<'ctx>> HintMeta<'a, 'ctx> for dyn Value<'a, 'ctx, T, E> + 'a { + type Known = (); - type Hint<'a> = () where 'ctx: 'a; + type Hint = (); } #[cfg(test)] |