diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index 7243e8ddc9b1..4d0956f018f6 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -255,7 +255,7 @@ impl<'s> AllocDecodingSession<'s> { // We already have a reserved AllocId. let alloc_id = alloc_id.unwrap(); trace!("decoded alloc {:?} {:#?}", alloc_id, allocation); - decoder.tcx().alloc_map.lock().set_id_same_memory(alloc_id, allocation); + decoder.tcx().alloc_map.lock().set_alloc_id_same_memory(alloc_id, allocation); Ok(alloc_id) }, AllocDiscriminant::Fn => { @@ -325,8 +325,8 @@ impl<'tcx> AllocMap<'tcx> { /// Obtains a new allocation ID that can be referenced but does not /// yet have an allocation backing it. /// - /// Make sure to call `set_id_memory` or `set_id_same_memory` before returning such an - /// `AllocId` from a query. + /// Make sure to call `set_alloc_id_memory` or `set_alloc_id_same_memory` before returning such + /// an `AllocId` from a query. pub fn reserve( &mut self, ) -> AllocId { @@ -390,13 +390,13 @@ impl<'tcx> AllocMap<'tcx> { // inside rustc? pub fn allocate(&mut self, mem: &'tcx Allocation) -> AllocId { let id = self.reserve(); - self.set_id_memory(id, mem); + self.set_alloc_id_memory(id, mem); id } /// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. Trying to /// call this function twice, even with the same `Allocation` will ICE the compiler. - pub fn set_id_memory(&mut self, id: AllocId, mem: &'tcx Allocation) { + pub fn set_alloc_id_memory(&mut self, id: AllocId, mem: &'tcx Allocation) { if let Some(old) = self.id_to_kind.insert(id, AllocKind::Memory(mem)) { bug!("tried to set allocation id {}, but it was already existing as {:#?}", id, old); } @@ -404,7 +404,7 @@ impl<'tcx> AllocMap<'tcx> { /// Freeze an `AllocId` created with `reserve` by pointing it at an `Allocation`. May be called /// twice for the same `(AllocId, Allocation)` pair. - pub fn set_id_same_memory(&mut self, id: AllocId, mem: &'tcx Allocation) { + pub fn set_alloc_id_same_memory(&mut self, id: AllocId, mem: &'tcx Allocation) { self.id_to_kind.insert_same(id, AllocKind::Memory(mem)); } } diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index cc96976e74a3..a42821a8c067 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -638,7 +638,7 @@ where // ensure llvm knows not to put this into immutable memory alloc.mutability = mutability; let alloc = self.tcx.intern_const_alloc(alloc); - self.tcx.alloc_map.lock().set_id_memory(alloc_id, alloc); + self.tcx.alloc_map.lock().set_alloc_id_memory(alloc_id, alloc); // recurse into inner allocations for &(_, alloc) in alloc.relocations.values() { // FIXME: Reusing the mutability here is likely incorrect. It is originally