Skip to content

Commit 982a966

Browse files
committed
Mention alloc in the name of the interning methods
1 parent 760df2c commit 982a966

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/librustc/mir/interpret/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl<'s> AllocDecodingSession<'s> {
255255
// We already have a reserved AllocId.
256256
let alloc_id = alloc_id.unwrap();
257257
trace!("decoded alloc {:?} {:#?}", alloc_id, allocation);
258-
decoder.tcx().alloc_map.lock().set_id_same_memory(alloc_id, allocation);
258+
decoder.tcx().alloc_map.lock().set_alloc_id_same_memory(alloc_id, allocation);
259259
Ok(alloc_id)
260260
},
261261
AllocDiscriminant::Fn => {
@@ -325,8 +325,8 @@ impl<'tcx> AllocMap<'tcx> {
325325
/// Obtains a new allocation ID that can be referenced but does not
326326
/// yet have an allocation backing it.
327327
///
328-
/// Make sure to call `set_id_memory` or `set_id_same_memory` before returning such an
329-
/// `AllocId` from a query.
328+
/// Make sure to call `set_alloc_id_memory` or `set_alloc_id_same_memory` before returning such
329+
/// an `AllocId` from a query.
330330
pub fn reserve(
331331
&mut self,
332332
) -> AllocId {
@@ -390,21 +390,21 @@ impl<'tcx> AllocMap<'tcx> {
390390
// inside rustc?
391391
pub fn allocate(&mut self, mem: &'tcx Allocation) -> AllocId {
392392
let id = self.reserve();
393-
self.set_id_memory(id, mem);
393+
self.set_alloc_id_memory(id, mem);
394394
id
395395
}
396396

397397
/// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. Trying to
398398
/// call this function twice, even with the same `Allocation` will ICE the compiler.
399-
pub fn set_id_memory(&mut self, id: AllocId, mem: &'tcx Allocation) {
399+
pub fn set_alloc_id_memory(&mut self, id: AllocId, mem: &'tcx Allocation) {
400400
if let Some(old) = self.id_to_kind.insert(id, AllocKind::Memory(mem)) {
401401
bug!("tried to set allocation id {}, but it was already existing as {:#?}", id, old);
402402
}
403403
}
404404

405405
/// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. May be called
406406
/// twice for the same `(AllocId, Allocation)` pair.
407-
pub fn set_id_same_memory(&mut self, id: AllocId, mem: &'tcx Allocation) {
407+
pub fn set_alloc_id_same_memory(&mut self, id: AllocId, mem: &'tcx Allocation) {
408408
self.id_to_kind.insert_same(id, AllocKind::Memory(mem));
409409
}
410410
}

src/librustc_mir/interpret/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ where
638638
// ensure llvm knows not to put this into immutable memory
639639
alloc.mutability = mutability;
640640
let alloc = self.tcx.intern_const_alloc(alloc);
641-
self.tcx.alloc_map.lock().set_id_memory(alloc_id, alloc);
641+
self.tcx.alloc_map.lock().set_alloc_id_memory(alloc_id, alloc);
642642
// recurse into inner allocations
643643
for &(_, alloc) in alloc.relocations.values() {
644644
// FIXME: Reusing the mutability here is likely incorrect. It is originally

0 commit comments

Comments
 (0)