Diffstat (limited to 'src/protocol/walker/hint.rs')
| -rw-r--r-- | src/protocol/walker/hint.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/protocol/walker/hint.rs b/src/protocol/walker/hint.rs index fdcc46a..c7d85d1 100644 --- a/src/protocol/walker/hint.rs +++ b/src/protocol/walker/hint.rs @@ -5,6 +5,7 @@ //! to the walker about what it is expecting. use crate::{ + any::{TypeName, TypeNameable}, nameable, protocol::{ControlFlow, Visitor}, }; @@ -37,9 +38,13 @@ pub trait Hint<'ctx, Protocol: HintMeta<'ctx>> { } nameable! { - pub ['a, 'ctx, Protocol] - dyn Hint<'ctx, Protocol> + 'a where {'ctx: 'a, Protocol: ?Sized} - dyn Hint<'ctx, Protocol::Nameable> + 'a where {'ctx: 'a, Protocol: ?Sized} + pub struct Name['a, 'ctx, Protocol]; + impl [Protocol::Name] for dyn Hint<'ctx, Protocol> + 'a where { + Protocol: TypeNameable<'a, 'ctx> + ?Sized, 'ctx: 'a + } + impl [Protocol] where dyn Hint<'ctx, Protocol::Nameable> + 'a { + Protocol: TypeName<'a, 'ctx> + ?Sized, 'ctx: 'a + } } #[cfg(test)] @@ -54,8 +59,8 @@ mod test { struct Y; nameable! { - ['a, 'ctx] - Y where {} + struct Name['a, 'ctx]; + impl for Y where {} } impl<'ctx, X> Hint<'ctx, Y> for X { |