Skip to content

Commit 4f46808

Browse files
committed
Add documentation to Bitcast arms about provenance.
1 parent d295a51 commit 4f46808

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

crates/core/src/abi.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,21 @@ pub enum Bitcast {
536536
I64ToI32,
537537
I64ToF32,
538538

539-
// Pointers
540-
P64ToI64,
541-
I64ToP64,
539+
// PointerOrI64<->Pointer conversions. These preserve provenance.
540+
//
541+
// These are used when pointer values are being stored in
542+
// (PToP64) and loaded out of (P64ToP) PointerOrI64 values, so they
543+
// always have to preserve provenance.
542544
P64ToP,
543545
PToP64,
546+
547+
// Pointer<->integer conversions. These do not preserve provenance.
548+
//
549+
// These are used when integer values are being stored in
550+
// (I64ToP64 and I32ToP) and loaded out of (P64ToI64 and PToI32) pointer
551+
// or PointerOrI64 values, so they never have any provenance to preserve.
552+
P64ToI64,
553+
I64ToP64,
544554
I32ToP,
545555
PToI32,
546556

0 commit comments

Comments
 (0)