volatile-register icon indicating copy to clipboard operation
volatile-register copied to clipboard

Usage of references is in conflict with use for MMIO

Open RalfJung opened this issue 6 years ago • 0 comments
trafficstars

Rust considers all references dereferencable and hence adds the dereferencable attribute. This allows the compiler to insert spurious reads from that reference. There is currently no way around that.

Some more discussions for context:

Unfortunately, this means the approach implemented by this crate is currently flawed: the compiler may insert spurious reads from an &RO<T> (or any of the other types, including WO).

The UCG thread is probably the best place to discuss possible solutions to this problem.

(I am not sure if this issue should be reported against this crate or vcell.)

RalfJung avatar May 26 '19 14:05 RalfJung