fortanix / rust-sgx

The Fortanix Rust Enclave Development Platform
https://edp.fortanix.com
Mozilla Public License 2.0
433 stars 98 forks source link

Export `WithId` in the Rust compiler and use it in rust-sgx #533

Open vn971 opened 12 months ago

vn971 commented 12 months ago

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.

This was originally raised here: https://github.com/fortanix/rust-sgx/pull/515#discussion_r1325844201