Diffstat (limited to 'src/build/builders/core/struct.rs')
| -rw-r--r-- | src/build/builders/core/struct.rs | 203 |
1 files changed, 114 insertions, 89 deletions
diff --git a/src/build/builders/core/struct.rs b/src/build/builders/core/struct.rs index 24172b3..6e304f9 100644 --- a/src/build/builders/core/struct.rs +++ b/src/build/builders/core/struct.rs @@ -2,12 +2,13 @@ use core::fmt::{Debug, Display}; use effectful::{ bound::Dynamic, - effective::Effective, - environment::{DynBind, Environment, NativeForm}, - tri, SendSync, + effective::{Effective, Canonical}, + environment::{Environment}, + tri, SendSync, DynBind }; use crate::{ + trait_by_id, any::{type_name, AnyTrait, OwnedStatic, TempBorrowedStatic}, build::BuilderTypes, hkt::Marker, @@ -27,17 +28,17 @@ use super::NoopVisitor; /// A builder for a struct. #[derive(SendSync)] -pub struct StructBuilder<'ctx, Info, Mode, E: Environment> +pub struct StructBuilder<'lt, 'ctx, Info, Mode, E: Environment> where - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, { - inner: Inner<'ctx, Info, Mode, E>, + inner: Inner<'lt, 'ctx, Info, Mode, E>, } #[derive(SendSync)] -enum Inner<'ctx, Info, Mode, E: Environment> +enum Inner<'lt, 'ctx, Info, Mode, E: Environment> where - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, { Temp, Seed(Info::Seed), @@ -68,7 +69,7 @@ enum StructKind { /// /// The `Mode` generic allows implementations to change depending on the mode the user gives. /// It is not used by the trait directly. -pub trait StructTypeInfo<'ctx, Mode: 'ctx, E: Environment>: 'static { +pub trait StructTypeInfo<'lt, 'ctx, Mode: 'ctx, E: Environment>: 'lt { /// A struct of builders for each field. type Builders: DynBind<E>; @@ -92,12 +93,12 @@ pub trait StructTypeInfo<'ctx, Mode: 'ctx, E: Environment>: 'static { const FIELD_COUNT: usize; /// Create a set of builders from a seed value. - fn new_builders<'a>(seed: Self::Seed) -> NativeForm<'a, Self::Builders, E>; + fn new_builders<'a>(seed: Self::Seed) -> Canonical<'a, Self::Builders, E>; /// Finish building the struct value. fn from_builders<'a>( builders: Self::Builders, - ) -> NativeForm<'a, Result<Dynamic<Self::T>, Self::Error>, E> + ) -> Canonical<'a, Result<Dynamic<Self::T>, Self::Error>, E> where Dynamic<Self::T>: DynBind<E>; @@ -107,7 +108,7 @@ pub trait StructTypeInfo<'ctx, Mode: 'ctx, E: Environment>: 'static { fn as_visitor<'a>( marker: Self::FieldMarker, builders: &'a mut Self::Builders, - ) -> DynVisitor<'a, 'ctx, E>; + ) -> DynVisitor<'a, 'lt, 'ctx, E>; /// Get a field marker from the index of the field. /// @@ -123,49 +124,49 @@ pub trait StructTypeInfo<'ctx, Mode: 'ctx, E: Environment>: 'static { /// Error that [`StructBuilder`] returns. #[derive(SendSync)] -pub struct StructError<'ctx, Info, M, E: Environment> +pub struct StructError<'lt, 'ctx, Info, M, E: Environment> where - Info: StructTypeInfo<'ctx, M, E>, + Info: StructTypeInfo<'lt, 'ctx, M, E>, { /// Error from the struct info definition. error: Info::Error, } -impl<'ctx, Info, Mode, E: Environment> StructError<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode, E: Environment> StructError<'lt, 'ctx, Info, Mode, E> where - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, { fn from_field_err(error: Info::Error) -> Self { Self { error } } } -impl<'ctx, Info, Mode, E: Environment> Debug for StructError<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode, E: Environment> Debug for StructError<'lt, 'ctx, Info, Mode, E> where - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { f.debug_tuple("StructError").field(&self.error).finish() } } -impl<'ctx, Info, Mode, E: Environment> Display for StructError<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode, E: Environment> Display for StructError<'lt, 'ctx, Info, Mode, E> where - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { Display::fmt(&self.error, f) } } -impl<'ctx, Info, Mode, E: Environment> BuilderTypes<E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode, E: Environment> BuilderTypes<E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, Dynamic<Info::T>: DynBind<E>, { type Seed = Info::Seed; - type Error = StructError<'ctx, Info, Mode, E>; + type Error = StructError<'lt, 'ctx, Info, Mode, E>; type Output = Dynamic<Info::T>; @@ -176,12 +177,12 @@ where } } -impl<'ctx, Info, Mode: 'ctx, E: Environment> StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E: Environment> StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, { - fn make_builders<'e>(&'e mut self) -> NativeForm<'e, (), E> + fn make_builders<'e>(&'e mut self) -> Canonical<'e, (), E> where 'ctx: 'e, { @@ -203,12 +204,11 @@ where } } -impl<'ctx, Info, Mode: 'ctx, E: Environment> Builder<'ctx, E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E: Environment> Builder<'lt, 'ctx, E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, Dynamic<Info::T>: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, Dynamic<OwnedStatic<usize>>: DynBind<E>, Dynamic<OwnedStatic<String>>: DynBind<E>, for<'a> Dynamic<&'a Info::T>: DynBind<E>, @@ -217,7 +217,7 @@ where for<'b, 'c> Dynamic<&'b type_name::Lowered<'b, 'c, Info::ValueT>>: DynBind<E>, for<'b> Dynamic<TempBorrowedStatic<'b, str>>: 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, { @@ -227,7 +227,7 @@ where .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, { @@ -252,13 +252,12 @@ where } } -impl<'ctx, Info, Mode: 'ctx, E: Environment> AsVisitor<'ctx, E> - for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E: Environment> AsVisitor<'lt, 'ctx, E> + for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, Dynamic<Info::T>: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, for<'a> Dynamic<&'a Info::T>: DynBind<E>, Dynamic<OwnedStatic<usize>>: DynBind<E>, @@ -267,20 +266,17 @@ where for<'b> Dynamic<TempBorrowedStatic<'b, str>>: DynBind<E>, for<'b, 'c> Dynamic<&'b type_name::Lowered<'b, 'c, Info::ValueT>>: DynBind<E>, { - fn as_visitor<'a>(&'a mut self) -> DynVisitor<'a, 'ctx, E> - where - 'ctx: 'a, - { + fn as_visitor(&mut self) -> DynVisitor<'_, 'lt, 'ctx, E> { DynVisitor(self) } } -impl<'ctx, Info, Mode, E: Environment> AnyTrait<'ctx> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx: 'lt, Info, Mode: 'lt, E: Environment> AnyTrait<'lt, 'ctx> for StructBuilder<'lt, 'ctx, Info, Mode, E> where for<'a> Dynamic<&'a Info::T>: DynBind<E>, E: Environment, Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, Dynamic<Info::T>: DynBind<E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, Dynamic<OwnedStatic<String>>: DynBind<E>, @@ -291,6 +287,20 @@ where Dynamic<Info::T>: DynBind<E>, Mode: 'ctx, { + fn upcast_by_id_mut<'a>( + &'a mut self, + id: crate::any::WithLtTypeId<'lt, 'ctx>, + ) -> Option<crate::any::MutAnyUnsized<'a, 'lt, 'ctx>> + where + 'lt: 'a, + { + dbg!(&id); + trait_by_id!(&mut self, id, { + type Impls = (dyn Tag<'ctx, tags::Map, E>, dyn Sequence<'ctx, E>); + }); + + None + } } // any_trait! { @@ -316,10 +326,10 @@ where // Mode: 'ctx, // } -impl<'ctx, Info, Mode: 'ctx, E> RequestHint<'ctx, E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E> RequestHint<'ctx, E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, Dynamic<Info::T>: DynBind<E>, for<'a> Dynamic<&'a Info::T>: DynBind<E>, for<'b, 'c> Dynamic<type_name::Lowered<'b, 'c, Info::ValueT>>: DynBind<E>, @@ -331,15 +341,15 @@ where E: Environment, { #[inline(always)] - fn request_hint<'this: 'e, 'walker: 'e, 'e>( + fn request_hint<'this: 'e, 'walker: 'e, 'd: 'e, 'e>( &'this mut self, - walker: DynWalker<'walker, 'ctx, E>, - ) -> NativeForm<'e, VisitResult, E> + walker: DynWalker<'walker, 'd, 'ctx, E>, + ) -> Canonical<'e, VisitResult, E> where 'ctx: 'this + 'walker, { E::value((self, walker)) - .update((), |_, (this, walker)| { + .update_map((), |_, (this, walker)| { // Start with a hint to use the value protocol to directly transfer the // struct value. hint_protocol::<dyn Value<'_, Info::ValueT, E>, _, _>(walker.cast(), *this, ()) @@ -390,16 +400,16 @@ where /// Allows for a walker to directly give the struct value. /// /// This skips needing to go through each field individually. -impl<'ctx, Info, Mode, E> Value<'ctx, Info::ValueT, E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode, E> Value<'ctx, Info::ValueT, E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, E: Environment, { fn visit<'this: 'value, 'value: 'e, 'e>( &'this mut self, value: type_name::Lowered<'value, 'ctx, Info::ValueT>, - ) -> NativeForm<'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, Info::ValueT>>>, E> + ) -> Canonical<'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, Info::ValueT>>>, E> where type_name::Lowered<'value, 'ctx, Info::ValueT>: Sized, Dynamic<type_name::Lowered<'value, 'ctx, Info::ValueT>>: DynBind<E>, @@ -416,20 +426,20 @@ where /// Allows for the walker to use field names. /// /// By default [`StructBuilder`] expects a tuple-like struct. -impl<'ctx, Info, Mode: 'ctx, E> Tag<'ctx, tags::Struct, E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E> Tag<'ctx, tags::Struct, E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, E: Environment, { fn visit<'this: 'e, 'walker: 'e, 'e>( &'this mut self, _kind: tags::Struct, walker: DynWalkerObjSafe<'walker, 'ctx, E>, - ) -> NativeForm<'e, VisitResult, E> { + ) -> Canonical<'e, VisitResult, E> { // If this protocol is used then we need to create the builders. E::value(self) - .update((), |_, this| this.make_builders().cast()) + .update_map((), |_, this| this.make_builders().cast()) .then(walker, |walker, (this, _)| { if let Inner::Builders { kind, .. } = &mut this.inner { // This signals to go into map mode for the sequence. @@ -446,20 +456,20 @@ where /// Allows for the walker to use field names. /// /// By default [`StructBuilder`] expects a tuple-like struct. -impl<'ctx, Info, Mode: 'ctx, E> Tag<'ctx, tags::Map, E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E> Tag<'ctx, tags::Map, E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, E: Environment, { fn visit<'this: 'e, 'walker: 'e, 'e>( &'this mut self, _kind: tags::Map, walker: DynWalkerObjSafe<'walker, 'ctx, E>, - ) -> NativeForm<'e, VisitResult, E> { + ) -> Canonical<'e, VisitResult, E> { // If this protocol is used then we need to create the builders. E::value(self) - .update((), |_, this| this.make_builders().cast()) + .update_map((), |_, this| this.make_builders().cast()) .then(walker, |walker, (this, _)| { if let Inner::Builders { kind, .. } = &mut this.inner { // This signals to go into map mode for the sequence. @@ -479,10 +489,10 @@ where /// /// If the [`tags::Struct`] or [`tags::Map`] tags are used then this will expect /// a sequence of key value pairs. Where the key is the field name. -impl<'ctx, Info, Mode: 'ctx, E> Sequence<'ctx, E> for StructBuilder<'ctx, Info, Mode, E> +impl<'lt, 'ctx, Info, Mode: 'ctx, E> Sequence<'ctx, E> for StructBuilder<'lt, 'ctx, Info, Mode, E> where Self: DynBind<E>, - Info: StructTypeInfo<'ctx, Mode, E>, + Info: StructTypeInfo<'lt, 'ctx, Mode, E>, for<'b> Dynamic<TempBorrowedStatic<'b, str>>: DynBind<E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, Dynamic<OwnedStatic<String>>: DynBind<E>, @@ -492,14 +502,14 @@ where fn visit<'a: 'c, 'b: 'c, 'c>( &'a mut self, scope: DynSequenceScope<'b, 'ctx, E>, - ) -> NativeForm<'c, VisitResult, E> + ) -> Canonical<'c, VisitResult, E> where 'ctx: 'a + 'b + 'c, { // If this protocol is used then we need to create the builders. E::value(self) - .update((), |_, this| this.make_builders().cast()) - .update(scope, |scope, (this, _)| { + .update_map((), |_, this| this.make_builders().cast()) + .update_map(scope, |scope, (this, _)| { match &mut this.inner { // We should treat the sequence as just values. Inner::Builders { @@ -526,8 +536,7 @@ where .next(visitor) .map((), |_, x| Flow::to_control_flow(x)) .cast() - }) - .map((), |_, (_, _, x)| x) + }, (), | _, _, _, x| x) .cast::<()>() } // We should treat the sequence as key value pairs. @@ -552,8 +561,7 @@ where .next(DynVisitor(visitor)) .map((), |_, x| Flow::to_control_flow(x)) .cast() - }) - .map((), |_, (_, _, x)| x) + }, (), |_, _, _, x| x) .cast() } // If we don't have the builders ... we can't do anything. @@ -570,22 +578,39 @@ where } #[derive(SendSync)] -struct FieldVisitor<'a, 'ctx, I: StructTypeInfo<'ctx, M, E>, M, E: Environment> { +struct FieldVisitor<'a, 'lt, 'ctx, I: StructTypeInfo<'lt, 'ctx, M, E>, M, E: Environment> { builders: &'a mut I::Builders, marker: Option<I::FieldMarker>, _marker: Marker<E>, } -impl<'a, 'ctx, I: StructTypeInfo<'ctx, M, E>, M, E: Environment> AnyTrait<'ctx> - for FieldVisitor<'a, 'ctx, I, M, E> +impl<'e, 'lt: 'e, 'ctx: 'lt, I: StructTypeInfo<'lt, 'ctx, M, E>, M: 'lt, E: Environment> AnyTrait<'e, 'ctx> + for FieldVisitor<'e, 'lt, 'ctx, I, M, E> where E: Environment, - I: StructTypeInfo<'ctx, M, E>, + I: StructTypeInfo<'lt, 'ctx, M, E>, Dynamic<OwnedStatic<usize>>: DynBind<E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, Dynamic<OwnedStatic<String>>: DynBind<E>, for<'b> Dynamic<TempBorrowedStatic<'b, str>>: DynBind<E>, { + fn upcast_by_id_mut<'a>( + &'a mut self, + id: crate::any::WithLtTypeId<'e, 'ctx>, + ) -> Option<crate::any::MutAnyUnsized<'a, 'e, 'ctx>> + where + 'e: 'a + { + dbg!(&id); + trait_by_id!(&mut self, id, { + type Impls = (dyn Tag<'ctx, tags::Key, E>); + }); + + self.marker.and_then(|marker| { + let x = I::as_visitor(marker, self.builders).0; + x.upcast_by_id_mut(id) + }) + } } // any_trait! { @@ -610,10 +635,10 @@ where // for<'b> Dynamic<TempBorrowedStatic<'b, str>>: DynBind<E>, // } -impl<'d, 'ctx, I, M, E> Tag<'ctx, tags::Key, E> for FieldVisitor<'d, 'ctx, I, M, E> +impl<'d, 'lt, 'ctx, I, M, E> Tag<'ctx, tags::Key, E> for FieldVisitor<'d, 'lt, 'ctx, I, M, E> where E: Environment, - I: StructTypeInfo<'ctx, M, E>, + I: StructTypeInfo<'lt, 'ctx, M, E>, Dynamic<OwnedStatic<usize>>: DynBind<E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, Dynamic<OwnedStatic<String>>: DynBind<E>, @@ -623,14 +648,14 @@ where &'a mut self, _key: tags::Key, walker: DynWalkerObjSafe<'b, 'ctx, E>, - ) -> NativeForm<'c, VisitResult, E> { + ) -> Canonical<'c, VisitResult, E> { let visitor = NameVisitor::<I, M, E> { field_marker: None, _marker: Default::default(), }; E::value((self, visitor, walker)) - .update((), |_, (_, visitor, walker)| { + .update_map((), |_, (_, visitor, walker)| { walker.walk(DynVisitor(visitor)).cast() }) .map((), |_, ((this, visitor, _), flow)| { @@ -642,16 +667,16 @@ where } #[derive(SendSync)] -struct NameVisitor<'ctx, I: StructTypeInfo<'ctx, M, E>, M, E: Environment> { +struct NameVisitor<'lt, 'ctx, I: StructTypeInfo<'lt, 'ctx, M, E>, M, E: Environment> { field_marker: Option<I::FieldMarker>, _marker: Marker<E>, } -impl<'ctx, I: StructTypeInfo<'ctx, M, E>, M, E: Environment> AnyTrait<'ctx> - for NameVisitor<'ctx, I, M, E> +impl<'lt, 'ctx: 'lt, I: StructTypeInfo<'lt, 'ctx, M, E>, M: 'lt, E: Environment> AnyTrait<'lt, 'ctx> + for NameVisitor<'lt, 'ctx, I, M, E> where E: Environment, - I: StructTypeInfo<'ctx, M, E>, + I: StructTypeInfo<'lt, 'ctx, M, E>, Dynamic<OwnedStatic<usize>>: DynBind<E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, Dynamic<OwnedStatic<String>>: DynBind<E>, @@ -674,15 +699,15 @@ where // for<'a> Dynamic<TempBorrowedStatic<'a, str>>: DynBind<E>, // } -impl<'ctx, I, M, E> Value<'ctx, OwnedStatic<usize>, E> for NameVisitor<'ctx, I, M, E> +impl<'lt, 'ctx, I, M, E> Value<'ctx, OwnedStatic<usize>, E> for NameVisitor<'lt, 'ctx, I, M, E> where E: Environment, - I: StructTypeInfo<'ctx, M, E>, + I: StructTypeInfo<'lt, 'ctx, M, E>, { fn visit<'this: 'value, 'value: 'e, 'e>( &'this mut self, value: type_name::Lowered<'value, 'ctx, OwnedStatic<usize>>, - ) -> NativeForm<'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, OwnedStatic<usize>>>>, E> + ) -> Canonical<'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, OwnedStatic<usize>>>>, E> where type_name::Lowered<'value, 'ctx, OwnedStatic<usize>>: Sized, Dynamic<type_name::Lowered<'value, 'ctx, OwnedStatic<usize>>>: DynBind<E>, @@ -703,7 +728,7 @@ where // fn visit<'a>( // &'a mut self, // TempBorrowedStatic(name): TypeName::T<'a, 'ctx, TempBorrowedStaticHrt<str>, E>, -// ) -> NativeForm<'a, VisitResult<Dynamic<TypeName::T<'a, 'ctx, TempBorrowedStaticHrt<str>, E>>>, E> +// ) -> Canonical<'a, VisitResult<Dynamic<TypeName::T<'a, 'ctx, TempBorrowedStaticHrt<str>, E>>>, E> // where // TypeName::T<'a, 'ctx, TempBorrowedStaticHrt<str>, E>: Sized, // 'ctx: 'a, @@ -714,16 +739,16 @@ where // } // } -impl<'ctx, I, M, E> Value<'ctx, OwnedStatic<&'static str>, E> for NameVisitor<'ctx, I, M, E> +impl<'lt, 'ctx, I, M, E> Value<'ctx, OwnedStatic<&'static str>, E> for NameVisitor<'lt, 'ctx, I, M, E> where E: Environment, - I: StructTypeInfo<'ctx, M, E>, + I: StructTypeInfo<'lt, 'ctx, M, E>, Dynamic<OwnedStatic<&'static str>>: DynBind<E>, { fn visit<'this: 'value, 'value: 'e, 'e>( &'this mut self, value: type_name::Lowered<'value, 'ctx, OwnedStatic<&'static str>>, - ) -> NativeForm< + ) -> Canonical< 'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, OwnedStatic<&'static str>>>>, E, @@ -739,16 +764,16 @@ where } } -impl<'ctx, I, M, E> Value<'ctx, OwnedStatic<String>, E> for NameVisitor<'ctx, I, M, E> +impl<'lt, 'ctx, I, M, E> Value<'ctx, OwnedStatic<String>, E> for NameVisitor<'lt, 'ctx, I, M, E> where E: Environment, - I: StructTypeInfo<'ctx, M, E>, + I: StructTypeInfo<'lt, 'ctx, M, E>, Dynamic<OwnedStatic<String>>: DynBind<E>, { fn visit<'this: 'value, 'value: 'e, 'e>( &'this mut self, value: type_name::Lowered<'value, 'ctx, OwnedStatic<String>>, - ) -> NativeForm< + ) -> Canonical< 'e, VisitResult<Dynamic<type_name::Lowered<'value, 'ctx, OwnedStatic<String>>>>, E, |