parallelsystems / bit-struct

ergonomic bitfields in Rust
12 stars 3 forks source link

fix UB with core::mem::transmute #4

Closed andrewgazelka closed 1 year ago

andrewgazelka commented 2 years ago

technically according to docs what we are doing is UB, but given our invariants perhaps it actually isn't (all tests pass at least on MacOS)... and it seems to work on cortex processors. This should be pretty easy to fix by using core::ptr instead.