Discussion topic about how structs are represented in Rust. Some things to work out:
Do we ever say anything about how a #[repr(rust)] struct is laid out
(and/or treated by the ABI)?
e.g., what about different structs with same definition
across executions of the same program?
For example, rkruppe writes that we might "want to guarantee (some subset of) newtype unpacking and relegate #[repr(transparent)] to being the way to guarantee to other crates that a type with private fields is and will remain a newtype?"
When is interop with #[rust(C)] guaranteed and what can we say there?
Actually, I see some of the latest comments here -- these are great. Perhaps we can redirect them to #35, which is a subissue on this topic? I'll copy over some of those now.
Discussion topic about how structs are represented in Rust. Some things to work out:
#[repr(rust)]
struct is laid out (and/or treated by the ABI)?#[repr(transparent)]
to being the way to guarantee to other crates that a type with private fields is and will remain a newtype?"#[rust(C)]
guaranteed and what can we say there?