paholg / dimensioned

Compile-time dimensional analysis for various unit systems using Rust's type system.
https://crates.io/crates/dimensioned
MIT License
300 stars 23 forks source link

Validate and ideally repace uses of `mem::transmute` #52

Closed paholg closed 6 years ago

paholg commented 6 years ago

There are two places in the make_units! macro where mem::transmute is used; for implementing Index and IndexMut. Both require going from &V to &$System<V, U> for some U.

I think that the current use should be safe, but would like external validation. It would also be nice to replace it with something less dangerous.