-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and circumvent new Rust 1.83 lints (#967)
Rust 1.83 now detects when we unnecessarily specify lifetimes that can be omitted in `impl` blocks: warning: the following explicit lifetimes could be elided: 'r --> ash/src/lib.rs:85:6 | 85 | impl<'r, T> RawPtr<T> for Option<&'r T> { | ^^ ^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes help: elide the lifetimes | 85 - impl<'r, T> RawPtr<T> for Option<&'r T> { 85 + impl<T> RawPtr<T> for Option<&T> { | 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 their `pNext` pointer, but no known `structextends` and hence no `push_next()` in the builder `impl` block. In this case clippy suggests to replace the otherwise-unused forwarding of `'a` in `impl<'a> StructName<'a>` to `impl StructName<'_>`. Then there is one special case remaining in `AllocationCallbacks` which only holds an opaque `p_user_data: *mut c_void` pointer but we still assign a lifetime and `PhantomData` 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.
- Loading branch information
Showing
6 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters