Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ash/src/vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub unsafe trait TaggedStructure<'a>: Sized {
/// # Panics
/// If `next` contains a pointer chain of its own, this function will panic. Call `unsafe`
/// [`Self::extend()`] to insert this chain instead.
fn push<T: Extends<Self> + TaggedStructure<'a>>(mut self, next: &'a mut T) -> Self {
fn push<'b: 'a, T: Extends<Self> + TaggedStructure<'b>>(mut self, next: &'a mut T) -> Self {
// SAFETY: All implementers of `TaggedStructure` are required to have the `BaseOutStructure` layout
let slf_base = unsafe { &mut *<*mut _>::cast::<BaseOutStructure<'_>>(&mut self) };
// SAFETY: All implementers of `T: TaggedStructure` are required to have the `BaseOutStructure` layout
Expand Down Expand Up @@ -110,7 +110,10 @@ pub unsafe trait TaggedStructure<'a>: Sized {
///
/// The last struct in this chain (i.e. the one where `p_next` is `NULL`) must be writable
/// memory, as its `p_next` field will be updated with the value of `self.p_next`.
unsafe fn extend<T: Extends<Self> + TaggedStructure<'a>>(mut self, next: &'a mut T) -> Self {
unsafe fn extend<'b: 'a, T: Extends<Self> + TaggedStructure<'b>>(
mut self,
next: &'a mut T,
) -> Self {
// `next` here can contain a pointer chain. This means that we must correctly attach he head
// to the root and the tail to the rest of the chain For example:
//
Expand Down