From d6250191a6580317adb5c5fc3b1126c46f80d8d6 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Tue, 4 Dec 2018 09:39:09 +0100 Subject: [PATCH] s/alloc_type/alloc_kind/ --- src/librustc/mir/interpret/mod.rs | 14 +++++++------- src/librustc_codegen_llvm/common.rs | 4 ++-- src/librustc_mir/monomorphize/collector.rs | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index fbfe0cdae6be..9708f7c6717f 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -103,9 +103,9 @@ pub fn specialized_encode_alloc_id< tcx: TyCtxt<'a, 'tcx, 'tcx>, alloc_id: AllocId, ) -> Result<(), E::Error> { - let alloc_type: AllocKind<'tcx> = + let alloc_kind: AllocKind<'tcx> = tcx.alloc_map.lock().get(alloc_id).expect("no value for AllocId"); - match alloc_type { + match alloc_kind { AllocKind::Memory(alloc) => { trace!("encoding {:?} with {:#?}", alloc_id, alloc); AllocDiscriminant::Alloc.encode(encoder)?; @@ -339,14 +339,14 @@ impl<'tcx> AllocMap<'tcx> { next } - fn intern(&mut self, alloc_type: AllocKind<'tcx>) -> AllocId { - if let Some(&alloc_id) = self.type_interner.get(&alloc_type) { + fn intern(&mut self, alloc_kind: AllocKind<'tcx>) -> AllocId { + if let Some(&alloc_id) = self.type_interner.get(&alloc_kind) { return alloc_id; } let id = self.reserve(); - debug!("creating alloc_type {:?} with id {}", alloc_type, id); - self.id_to_type.insert(id, alloc_type.clone()); - self.type_interner.insert(alloc_type, id); + debug!("creating alloc_kind {:?} with id {}", alloc_kind, id); + self.id_to_type.insert(id, alloc_kind.clone()); + self.type_interner.insert(alloc_kind, id); id } diff --git a/src/librustc_codegen_llvm/common.rs b/src/librustc_codegen_llvm/common.rs index 0d9c417f5229..194b6b4e2706 100644 --- a/src/librustc_codegen_llvm/common.rs +++ b/src/librustc_codegen_llvm/common.rs @@ -316,8 +316,8 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> { } }, Scalar::Ptr(ptr) => { - let alloc_type = self.tcx.alloc_map.lock().get(ptr.alloc_id); - let base_addr = match alloc_type { + let alloc_kind = self.tcx.alloc_map.lock().get(ptr.alloc_id); + let base_addr = match alloc_kind { Some(AllocKind::Memory(alloc)) => { let init = const_alloc_to_llvm(self, alloc); if alloc.mutability == Mutability::Mutable { diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index ec5c57ee0ba6..289402d3b46a 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -1161,8 +1161,8 @@ fn collect_miri<'a, 'tcx>( alloc_id: AllocId, output: &mut Vec>, ) { - let alloc_type = tcx.alloc_map.lock().get(alloc_id); - match alloc_type { + let alloc_kind = tcx.alloc_map.lock().get(alloc_id); + match alloc_kind { Some(AllocKind::Static(did)) => { let instance = Instance::mono(tcx, did); if should_monomorphize_locally(tcx, &instance) {