fix(rust: builder): add lifetime bounds to finish methods
This change addresses a reported issue where a FlatBufferBuilder could be finished with a WIPOffset created by a different builder.
Calling builder1.finish(offset_from_builder2) would compile but result in a runtime panic or data corruption, as the offset is meaningless in builder1's buffer.
The fix enforces the builder's lifetime ('fbb) on the generic type T of the WIPOffset in all finish methods (finish, finish_minimal, finish_size_prefixed, and finish_with_opts).
https://github.com/google/flatbuffers/issues/8698
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
this seems good to me (as a rust n00b) -- is there a way we can write a regression test against this as part of this PR?