Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension structs have lifetimes even when they don't need one #906

Open
Rua opened this issue Apr 14, 2024 · 0 comments
Open

Extension structs have lifetimes even when they don't need one #906

Rua opened this issue Apr 14, 2024 · 0 comments

Comments

@Rua
Copy link
Contributor

Rua commented Apr 14, 2024

Extension structs do contain pointers, but their lifetime cannot ever be used if the only pointer they contain is p_next. Structs like this don't actually borrow anything, all structures in a p_next chain are borrowed by the parent. They have no push_next method, and there are no other methods that return Self with a different lifetime than the input struct. Technically you can set the lifetime using the PhantomData member, but that seems a bit silly and pointless.

Take ExternalMemoryImageCreateInfo for example. It has no methods that borrow data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant