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

Disallow all as casts on pointers with clippy::ptr_as_ptr #686

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions ash/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ impl Device {
buffer,
offset,
data.len() as u64,
data.as_ptr() as _,
data.as_ptr().cast(),
);
}

Expand Down Expand Up @@ -1776,8 +1776,8 @@ impl Device {
layout,
stage_flags,
offset,
constants.len() as _,
constants.as_ptr() as _,
constants.len() as u32,
constants.as_ptr().cast(),
);
}

Expand Down Expand Up @@ -2203,12 +2203,12 @@ impl Device {
&self,
pipeline_cache: vk::PipelineCache,
) -> VkResult<Vec<u8>> {
read_into_uninitialized_vector(|count, data| {
read_into_uninitialized_vector(|count, data: *mut u8| {
(self.device_fn_1_0.get_pipeline_cache_data)(
self.handle(),
pipeline_cache,
count,
data as _,
data.cast(),
)
})
}
Expand Down
2 changes: 1 addition & 1 deletion ash/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![deny(clippy::use_self)]
#![deny(clippy::use_self, clippy::ptr_as_ptr/* , clippy::as_underscore */)]
#![warn(trivial_casts, trivial_numeric_casts)]
#![allow(
clippy::too_many_arguments,
Expand Down
Loading