[roll] Roll fuchsia [packet] Relax BufferView lifetime for &mut &[u8]

In our implementation of `BufferView` for `&'b mut &'a [u8]`, we
previously used the more restricted lifetime `'b`. Concretely, we had
the impl:

  impl<'b, 'a: 'b> BufferView<&'b [u8]> for &'b mut &'a [u8]

This is problematic because it means that, if a caller holds a reference
with lifetime `'b` to an object which owns a buffer with the longer
lifetime `'a`, the caller can only use `BufferView` with the shorter
lifetime `'b`. In practice, this has consequences for situations like
parsing a packet from a buffer which is stored in a local variable. If
the buffer's storage has a longer lifetime, we want to be able to parse
and produce a packet object with that same lifetime, but this
`BufferView` impl means that we can only produce a packet object with
the shorter lifetime of the local variable.

We change this impl to use the longer lifetime `'a`:

  impl<'b, 'a: 'b> BufferView<&'a [u8]> for &'b mut &'a [u8]

This solves the problem, and allows us to parse a packet object with a
lifetime which outlives the lifetime of the local variable used to store
the buffer.

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/594026
Original-Revision: 9d59b7ded5f686bc0faf20744564394bd3ddcf01
GitOrigin-RevId: 5c6582c59192abe9d2148f276c86fa8d8ec8021e
Change-Id: I828a20a0448d17ab714a23a3d71788c67466c6b9
1 file changed
tree: 18960699c5601186d23c2942af56f9e7a398fc97
  1. infra/
  2. third_party/
  3. firmware
  4. flower
  5. jiri.lock
  6. minimal
  7. prebuilts
  8. README.md
  9. stem
  10. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.