[1.95.0] Document provenance and its use in const eval#707
[1.95.0] Document provenance and its use in const eval#707kirtchev-adacore wants to merge 1 commit into
Conversation
812a13f to
ecca0f0
Compare
The information has been taken from - [core::ptr Provenance](https://doc.rust-lang.org/core/ptr/index.html#provenance) - [reference#2091](rust-lang/reference#2091) - [reference#2139](rust-lang/reference#2138)
ecca0f0 to
21bb6de
Compare
| well-formed indirection value | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| A :dt:`well-formed indirection value` is an :t:`indirection value` with :t:`provenance`, where all bytes that comprise the :t:`indirection value` are part of the same group. |
There was a problem hiding this comment.
the definition feels incomplete, but I don't know yet how to fill it... maybe inspiration can be taken from a review from my old pr
There was a problem hiding this comment.
Maybe
... bytes that comprise the :t:`indirection value` are initialized and are part
of the same group.Basically we want to say that an indirection value does not (somehow) contain the bytes of something else.
There was a problem hiding this comment.
Right.
I think what the Reference PRs and core::ptr are trying to say is that you can obtain a value by doing sketchy things, such as memory transmutation. If you plan on using that value as an indirection value with provenance, then the value better have "correct bytes", what 2091 calls "bytes must be fragments of the same original pointer value in the correct order" and 2138 calls "part of an adjacent group of correctly-ordered bytes that form an entire pointer".
The information has been taken from