File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
compiler/rustc_middle/src/mir/interpret Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -107,8 +107,12 @@ impl<T: HasDataLayout> PointerArithmetic for T {}
107107/// pointer), but `derive` adds some unnecessary bounds.
108108pub trait Provenance : Copy + fmt:: Debug {
109109 /// Says whether the `offset` field of `Pointer`s with this provenance is the actual physical address.
110- /// If `true, ptr-to-int casts work by simply discarding the provenance.
111- /// If `false`, ptr-to-int casts are not supported. The offset *must* be relative in that case.
110+ /// - If `false`, the offset *must* be relative. This means the bytes representing a pointer are
111+ /// different from what the Abstract Machine prescribes, so the interpreter must prevent any
112+ /// operation that would inspect the underlying bytes of a pointer, such as ptr-to-int
113+ /// transmutation. A `ReadPointerAsBytes` error will be raised in such situations.
114+ /// - If `true`, the interpreter will permit operations to inspect the underlying bytes of a
115+ /// pointer, and implement ptr-to-int transmutation by stripping provenance.
112116 const OFFSET_IS_ADDR : bool ;
113117
114118 /// We also use this trait to control whether to abort execution when a pointer is being partially overwritten
You can’t perform that action at this time.
0 commit comments