Derive failure for `&[T]`
bowenwang1996 opened this issue · comments
Bowen Wang commented
If I have the following structs
#[derive(BorshSerialize]
struct A {}
#[derive(BorshSerialize)]
struct B<'a> {
a: &'a [A]
}
The derive for B
will fail even though we have derive for [T]
and &T
if T
implements BorshSerialize
. It fails with "size for value cannot be known at compile time. If I change [A]
to Vec<A>
, it works.
Evgeny Kuzyakov commented
I think BorshSerialize requires Sized
, but we probably can lift this requirement. You still need it for BorshDeserialize