str does not implement Tagged despite implementing FixedTag because the blanket impl implicitly requires Sized:
impl<T: FixedTag> Tagged for T {
fn tag(&self) -> Tag {
T::TAG
}
}
The impl should look like this instead:
impl<T: FixedTag + ?Sized> Tagged for T {
fn tag(&self) -> Tag {
T::TAG
}
}
The blanket impl of Encode has the same problem:
impl<T> Encode for T
where
T: EncodeValue + Tagged,
{
// ...
}
It should look like this:
impl<T> Encode for T
where
T: EncodeValue + Tagged + ?Sized,
{
// ...
}
Without this, it's impossible to invoke methods of Encode on str.
strdoes not implementTaggeddespite implementingFixedTagbecause the blanket impl implicitly requiresSized:The impl should look like this instead:
The blanket impl of
Encodehas the same problem:It should look like this:
Without this, it's impossible to invoke methods of
Encodeonstr.