diff --git a/src/collected_substring.rs b/src/collected_substring.rs index 59eee9c..a97b790 100644 --- a/src/collected_substring.rs +++ b/src/collected_substring.rs @@ -12,7 +12,7 @@ pub trait Keyword { ) -> Option + use<'keyword, Self, C>>; } -pub trait CollectedSubstring { +pub trait CollectedSubstring: Sized { type C: Copy; fn compareKeyword(&self, kw: impl Keyword) -> bool; } diff --git a/src/converter/converters.rs b/src/converter/converters.rs index 71e9cfd..aef80b1 100644 --- a/src/converter/converters.rs +++ b/src/converter/converters.rs @@ -19,7 +19,7 @@ pub trait StreamConverter_Substring>: } pub trait StreamConverter>: - StreamConverter_Char + StreamConverter_Pos

+ StreamConverter_Substring + Sized + StreamConverter_Char + StreamConverter_Pos

+ StreamConverter_Substring { } @@ -27,7 +27,7 @@ impl< C: Copy, P: Pos, CS: CollectedSubstring, - W: StreamConverter_Char + StreamConverter_Pos

+ StreamConverter_Substring, + W: Sized + StreamConverter_Char + StreamConverter_Pos

+ StreamConverter_Substring, > StreamConverter for W { } diff --git a/src/pos/pos.rs b/src/pos/pos.rs index ad8ef90..7752a59 100644 --- a/src/pos/pos.rs +++ b/src/pos/pos.rs @@ -1,4 +1,4 @@ -pub trait Pos {} +pub trait Pos: Sized {} impl Pos for () {} -impl Pos for usize {} \ No newline at end of file +impl Pos for usize {} diff --git a/src/pos/pos_counter.rs b/src/pos/pos_counter.rs index 755f9af..0e27806 100644 --- a/src/pos/pos_counter.rs +++ b/src/pos/pos_counter.rs @@ -1,9 +1,9 @@ use crate::pos::Pos; -pub trait PosCounter { +pub trait PosCounter: Sized { type P: Pos; fn update(&mut self, c: C); fn export(&self) -> Self::P; -} \ No newline at end of file +}