Philipp Oppermann
Philipp Oppermann
I started to prototype a possible implementation in https://github.com/rust-osdev/volatile/blob/volatile-cell/src/cell.rs (based on #29). It looks like there is indeed no `dereferenceable` attribute emitted for `VolatileCell` read on recent compiler versions: ```...
Unfortunately, the `dereferenceable` attribute is still emitted for methods that take `&mut self`, e.g. `VolatileCell::write`. We could take `&self` in these methods as a fix, but this would force us...
cc @RalfJung @Lokathor @kevinaboos
> I kinda fundamentally don't get what you're going for here. The main motivation for an "owned" type like this that you can abstract the MMIO memory using normal `repr(C)`...
@repnop Thanks a lot for the info! > It is my understanding that `&mut` should pretty much _never_ be involved with a `VolatileCell` abstraction, as it makes too many guarantees...
> I just don't think Rust as it is today can handle this. Probably, but I still would like to understand what's the actual issue. Is there a potential codegen...
@Freax13 > Instead of creating references to `T`, create references to zero sized types. This bypasses the whole `dereferencable` problem by reducing the amount of bytes that LLVM could dereference...
Ah, but then we would need to store the field offsets somewhere. So we could get something similar to @Lokathor's proposal above: > If you absolutely need it to look...
> Forgive me if this has been answered, but were there any soundness or other problem(s) identified with the old version `
Blocked on https://github.com/rust-lang/unsafe-code-guidelines/issues/411