ash/generator
Marijn Suijten e5b08732db
generator: Work around invariance for assigning mutable pointer of lifetimed slice (#841)
In essence this builder function needs to adhere to two rules:
1. No ref-after-free: the slice must outlive (uses of) the builder
   object;
2. No aliasing: the slice cannot be (im)mutably used while it is mutably
   borrowed within a live builder object.

These two rules have been tested and are satisfied by the given builder
implementation.  Without this change `timings` seems to be borrowing
itself, hence is not allowed to be used after it has been temporarily
mutably borrowed inside the builder, even after that builder was
dropped.  Thus defeating the purpose of this "getter" API via a struct.

Without the `.cast()`, because mutable raw pointers are invariant
(i.e. there is no subtyping relationship) the compiler complains about
requiring `self` to outlive `timings` instead, which does not satisfy
the two rules above.
2023-12-02 19:52:35 +01:00
..
src generator: Work around invariance for assigning mutable pointer of lifetimed slice (#841) 2023-12-02 19:52:35 +01:00
Vulkan-Headers@9d27c893cd Update Vulkan-Headers to 1.3.271 (#816) 2023-11-28 15:05:27 +01:00
Cargo.toml build(deps): update syn requirement from 1.0 to 2.0 (#834) 2023-11-27 09:33:50 +01:00