5 ms·
I 100% support this endeavor and I'm fully down to RIIR for everything but wish to address one slight problem I have with the text: > Recently, we even had one
by Veliladon 4y ago
I 100% support this endeavor and I'm fully down to RIIR for everything but wish to address one slight problem I have with the text:
> Recently, we even had one bug which was caused by accidentally truncating a 64-bit unsigned integer to 32 bits deep inside the common Vulkan synchronization code.
> It doesn't have implicit type casting so accidental sign promotion or integer truncation doesn't happen.
It doesn't have implicit type casting but if you u64 as u32 inside a piece of Rust code it'll overflow panic in debug mode at best but happily wrap around when compiled in release mode at worst.
- heinrich5991 4y agou64 as u32 is defined as wrapping (unfortunately, IMO), so it will never panic, not even in debug mode.
- tialaramex 4y agoI would prefer that u64 as u32 and similar lossy conversions get deprecated in some future Edition encouraging people write try_into and thus take a moment to decide what happens when it won't fit. But yeah, meanwhile the only difference in Rust is that you did explicitly say you wanted the conversion. EtA: the pointer as usize conversions will presumably get deprecated once Aria's provenance experiment is solidified. So that's a precedent for deprecating something like this where the risk outweighs the convenience.
- swsieber 4y agoIIRC they has been at least one proposal working towards that.
- wahern 4y agoFor the curious (I was), I believe this is the associated commit: https://github.com/Mesa3D/mesa/commit/f2e535e4fed5bdc13e11a443316a4b77cd5eb81a https://github.com/Mesa3D/mesa/commit/f2e535e4fed5bdc13e11a4...