@RalfJ Hi friend. I have a question related to the recent discussion in the lang team meeting.
In my own crate, so far I don't have the problem with raw hardware addresses and const eval interacting badly because I ended up making a type (
VolAddress<T>) which is internally a
PhantomData<T>, and then all the
const fn manipulations of this type do const math to offset the address or whatever thing, while the actual reading and writing of the memory (where the address value is cast to
*mut T at the last minute) isn't
const fn so you simply can't end up writing a
const expression where you'd read or write the memory. I think I'm just naturally saved in this situation by the type system.
My question to you is, "does this sound like a sane and correct approach?" or is there perhaps something I missed that would make this a fall down suddenly?
yeah I'm a fan of that approach :D
@Lokathor you are basically typing your integer addresses as
usize instead of using pointers. which in some sense is more correct.