Neat. Lots of 'unsafe' hardware access in this. Always makes me wonder if Rust should look into something like Representation Clauses like in Ada.
https://learn.adacore.com/courses/advanced-ada/parts/data_ty...
It would allow for compiler level protection from writing wrong data into a register.
Anybody know if that is planned for Rust.
Any hardware access is always going to be unsafe, because the compiler cannot know what the hardware does. For all it knows, it could change the memory of the running app. There's no implementation that cares about ownership where that goes away.