give Pointer::into_parts a more scary name and offer a safer alternative

This commit is contained in:
Ralf Jung
2025-06-28 15:20:33 +02:00
parent a28aa95845
commit 0bd5a21843
+1 -1
View File
@@ -133,7 +133,7 @@ pub(crate) fn codegen_const_value<'tcx>(
}
}
Scalar::Ptr(ptr, _size) => {
let (prov, offset) = ptr.into_parts(); // we know the `offset` is relative
let (prov, offset) = ptr.prov_and_relative_offset();
let alloc_id = prov.alloc_id();
let base_addr = match fx.tcx.global_alloc(alloc_id) {
GlobalAlloc::Memory(alloc) => {