rust-aliasable
rust-aliasable copied to clipboard
[Feature] AliasableMut/AliasableBox could use #[repr(transparent)]
If a user wants to pass these directly for use in FFI (not directly the intended use, but plausible and related to some uses), they need to be repr(transparent). Similarly, they could possibly use as_mut_ptr()/into_raw() that do not ever construct a Unique/&mut reference to the target (which would also be a less-pleasant workaround for the first thing).
This is a good idea.
alloc::boxed::Boxdoesn't seem to be transparent due to future support around non-zero size handles to allocators, which might be something that might be wanted to be supported here too in the future. As you said, a middle ground providingas_mut_ptr()/into_raw()could be a good idea.AliasableMutseems like a good fit for being maderepr(transparent)however!