Skip to content

Commit d0856d8

Browse files
committed
refactor: Update 'fn allocate_bytes()' return type and restore comments
- Modify allocate_bytes() to return more appropriate pointer type - Revert dedup function documentation to original version per review Signed-off-by: shamb0 <r.raajey@gmail.com>
1 parent f1dfcab commit d0856d8

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_const_eval/src/interpret

1 file changed

+1
-1
lines changed

compiler/rustc_const_eval/src/interpret/place.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ where
10341034
let salt = M::get_global_alloc_salt(self, None);
10351035
let id = self.tcx.allocate_bytes_dedup(bytes, salt);
10361036

1037-
// Transform allocation ID to a machine-specific pointer with proper provenance
1037+
// Turn untagged "global" pointers (obtained via `tcx`) into the machine pointer to the allocation.
10381038
M::adjust_alloc_root_pointer(&self, Pointer::from(id), Some(kind))
10391039
} else {
10401040
// Allocate new memory for mutable data

0 commit comments

Comments
 (0)