Currently, our codebase uses transmute to handle "internal" and "external" definitions of WithId in Rust standard library (the SGX platform of it) and in rust-sgx (this repository). While technically currently "safe", we're lacking compiler-enforced checks on this type. It is arguably safer to rather export WithId and re-use it, thus avoiding the need for std::mem::transmute.
Currently, our codebase uses transmute to handle "internal" and "external" definitions of
WithId
in Rust standard library (the SGX platform of it) and in rust-sgx (this repository). While technically currently "safe", we're lacking compiler-enforced checks on this type. It is arguably safer to rather exportWithId
and re-use it, thus avoiding the need forstd::mem::transmute
.This was originally raised here: https://github.com/fortanix/rust-sgx/pull/515#discussion_r1325844201