We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7777a8a + 80f2e7e commit ca9649dCopy full SHA for ca9649d
gdnative-core/src/rid.rs
@@ -27,7 +27,13 @@ impl Rid {
27
}
28
29
fn to_u64(&self) -> u64 {
30
- unsafe { transmute(self.0) }
+ unsafe {
31
+ // std::mem::transmute needs source and destination types to have the same size. On 32
32
+ // bit systems sizeof(void *) != size_of<u64>() so this fails to compile. The bindings
33
+ // define godot_rid as (a newtype of) [u8; u8size] or [u8; u4size] depending on
34
+ // architecture word size so transmuting to usize should always work.
35
+ transmute::<_, usize>(self.0) as _
36
+ }
37
38
39
#[doc(hidden)]
0 commit comments