e5b08732db
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. |
||
---|---|---|
.. | ||
src | ||
Vulkan-Headers@9d27c893cd | ||
Cargo.toml |