Added missed 'Sized' constraint to traits

This commit is contained in:
Andrew Golovashevich 2025-12-05 21:30:39 +03:00
parent 2bb3b7a9a9
commit b45df143d2
4 changed files with 7 additions and 7 deletions

View File

@ -12,7 +12,7 @@ pub trait Keyword<C: Copy> {
) -> Option<impl KeywordComparatorIterator<C> + use<'keyword, Self, C>>; ) -> Option<impl KeywordComparatorIterator<C> + use<'keyword, Self, C>>;
} }
pub trait CollectedSubstring { pub trait CollectedSubstring: Sized {
type C: Copy; type C: Copy;
fn compareKeyword(&self, kw: impl Keyword<Self::C>) -> bool; fn compareKeyword(&self, kw: impl Keyword<Self::C>) -> bool;
} }

View File

@ -19,7 +19,7 @@ pub trait StreamConverter_Substring<C: Copy, CS: CollectedSubstring<C = C>>:
} }
pub trait StreamConverter<C: Copy, P: Pos, CS: CollectedSubstring<C = C>>: pub trait StreamConverter<C: Copy, P: Pos, CS: CollectedSubstring<C = C>>:
StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS> Sized + StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>
{ {
} }
@ -27,7 +27,7 @@ impl<
C: Copy, C: Copy,
P: Pos, P: Pos,
CS: CollectedSubstring<C = C>, CS: CollectedSubstring<C = C>,
W: StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>, W: Sized + StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>,
> StreamConverter<C, P, CS> for W > StreamConverter<C, P, CS> for W
{ {
} }

View File

@ -1,4 +1,4 @@
pub trait Pos {} pub trait Pos: Sized {}
impl Pos for () {} impl Pos for () {}
impl Pos for usize {} impl Pos for usize {}

View File

@ -1,6 +1,6 @@
use crate::pos::Pos; use crate::pos::Pos;
pub trait PosCounter<C: Copy> { pub trait PosCounter<C: Copy>: Sized {
type P: Pos; type P: Pos;
fn update(&mut self, c: C); fn update(&mut self, c: C);