Integrating with patterns that cannot be proved safe by the rust compiler is always going to require unsafe. Instead of attempting to provide a general solution for all data types of interest, perhaps each one should be manually wrapped in a safe interface, when possible? And if a gauranteed safe interface is not possible, then resort to unsafe.
I would like to see support for safe in-place intialization of heap structures prioritized, though. That is definitely a weakness in the existing Rust language that has bitten me before. Particularly when attempting to keep a very large struct containing multiple arrays contiguous in heap memory, to make memcopy’s cheap.
Integrating with patterns that cannot be proved safe by the rust compiler is always going to require
unsafe
. Instead of attempting to provide a general solution for all data types of interest, perhaps each one should be manually wrapped in a safe interface, when possible? And if a gauranteed safe interface is not possible, then resort tounsafe
.I would like to see support for safe in-place intialization of heap structures prioritized, though. That is definitely a weakness in the existing Rust language that has bitten me before. Particularly when attempting to keep a very large struct containing multiple arrays contiguous in heap memory, to make memcopy’s cheap.