[Rust] [Reflection] `get_field_vector()` only works for vectors of primitive types
Open
rust
stale
- Dominant language
- C++
- Stars
- 26.5k
- Forks
- 3.7k
- PR merge metrics
- No merged PRs in 30d
Description
The test on https://github.com/google/flatbuffers/blob/master/rust/reflection/src/lib.rs#L185 requires that the size of `T` is equal to `get_type_size()` of the field element base type. However, if the base type is `Obj` and e.g. `T` is `Table` or a 16-byte struct of 4 floats, this will fail, because `get_type_size()` always returns 4 for `Obj`.
Upon closer inspection, it seems that this behavior is copied verbatim from the C++ implementation. The original authors do seem to have been aware of this though given [`VerifyVectorOfStructs()`](https://github.com/google/flatbuffers/blob/master/src/reflection.cpp#L47-L56) doesn't use `GetFieldV()` at all.
Contributor guide
Assessment
This issue has not been assessed yet.