Closed direc85 closed 1 year ago
Would it not be better to upsize the older Rust types, instead of chopping the new one?
As said in the issue, this is fixed already in master, I'm only affected because I'm running 0.2.5-ish due to Rust 1.52.1. Closing as irrelevant.
thanks for your patch anyway.
Obviously, this breaks Rust <1.72, but I couldn't find a neat way to conditionally include the changes using. It doesn't seem to be possible to have something like
#[cfg(version >= "1.72")]
or#[cfg(TYPE_ID_SIZE == 16)]
, or perhaps I just didn't find the correct keyword to use.Not sure if either method is good enough for master, but at least there's something that works:
Approach 1:
unsafe { transmute }
Approach 2: Custom hasher which utilizes
TypeId.hash()
which internally castsu128
→u64
Improvements and further ideas welcome :sweat_smile:
Fixes #299