Open joshlf opened 1 year ago
Yeah that text is super restrictive. Note that the entire set of rules here starts out saying
The precise rules for validity are not determined yet. The guarantees that are provided at this point are very minimal:
We have a huge grey area of code accepted by Stacked Borrows but not guaranteed to be accepted by the eventual final memory model.
The code in your example is definitely intended to be allowed.
The
ptr
module docs say:This seems to imply that accessing a
*const T
while a&T
is live is illegal, which is surprisingly restrictive. The following code seems intuitively fine, and is accepted by Miri, but seems to violate this rule:Am I misinterpreting this text? Is this intended to be unsound and Miri just needs to be taught to catch it? Should the text be relaxed?