Skip to content

Commit fc3279c

Browse files
committed
Remove integer to pointer cast in Handle implementation
... so that Handle::from_raw is more friendly to miri tests with strict provenance. Closes #996
1 parent 55dc692 commit fc3279c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ash/src/vk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use platform_types::*;
3333
pub trait Handle: Sized {
3434
const TYPE: ObjectType;
3535
fn as_raw(self) -> u64;
36-
fn from_raw(_: u64) -> Self;
36+
fn from_raw(_: *mut u8) -> Self;
3737

3838
/// Returns whether the handle is a `NULL` value.
3939
///

ash/src/vk/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ macro_rules! define_handle {
137137
fn as_raw(self) -> u64 {
138138
self.0 as u64
139139
}
140-
fn from_raw(x: u64) -> Self {
141-
Self(x as _)
140+
fn from_raw(x: *mut u8) -> Self {
141+
Self(x)
142142
}
143143
}
144144
unsafe impl Send for $name {}

0 commit comments

Comments
 (0)