]> git.lizzy.rs Git - rust.git/commitdiff
Mention `alloc` in the name of the interning methods
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 4 Dec 2018 09:01:58 +0000 (10:01 +0100)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Tue, 4 Dec 2018 09:01:58 +0000 (10:01 +0100)
src/librustc/mir/interpret/mod.rs
src/librustc_mir/interpret/memory.rs

index 7243e8ddc9b1f48870f0914c1b036afddbce7d8c..4d0956f018f6a2453b1c138dd6ce86e53abae90f 100644 (file)
@@ -255,7 +255,7 @@ pub fn decode_alloc_id<'a, 'tcx, D>(&self,
                     // 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 @@ pub fn new() -> Self {
     /// 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 @@ pub fn intern_static(&mut self, static_id: DefId) -> AllocId {
     // 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 @@ pub fn set_id_memory(&mut self, id: AllocId, mem: &'tcx Allocation) {
 
     /// 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));
     }
 }
index cc96976e74a3055516a947b0cdc9bd605d366738..a42821a8c067732051ef858391b167866461b49b 100644 (file)
@@ -638,7 +638,7 @@ pub fn intern_static(
         // 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