Fix and circumvent new Rust 1.83 lints #967
Merged
+13
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rust 1.83 now detects when we unnecessarily specify lifetimes that can be omitted in
impl
blocks:Simple manual cases are solved but autogenerated code is omitted via
allow(clippy::needless_lifetimes)
because they are incredibly hard to track correctly; we might solve these individually in followup PRs. The main cause of these violations is structs with only a reference via theirpNext
pointer, but no knownstructextends
and hence nopush_next()
in the builderimpl
block. In this case clippy suggests to replace the otherwise-unused forwarding of'a
inimpl<'a> StructName<'a>
toimpl StructName<'_>
.Then there is one special case remaining in
AllocationCallbacks
which only holds an opaquep_user_data: *mut c_void
pointer but we still assign a lifetime andPhantomData
to it. We don't track/update the lifetime in the builder at all and might as well strip the lifetime away from this structure entirely.Finally, clippy detects that our
ash-examples
crate doesn't have an MSRV and suggests to use C-string literals which are stable since Rust 1.77.