diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-04 09:59:36 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-04 09:59:36 +0100 |
| commit | 760df2c3d0e0ef2f12b164bfbf32348d555fbe15 (patch) | |
| tree | 89ef1010ef1369f88f713538f0872ec9847c00bd | |
| parent | 66b2353a4cc0f21f6c9d0f7bd4a54d221ad09fa6 (diff) | |
| download | rust-760df2c3d0e0ef2f12b164bfbf32348d555fbe15.tar.gz rust-760df2c3d0e0ef2f12b164bfbf32348d555fbe15.zip | |
s/id_to_type/id_to_kind/
| -rw-r--r-- | src/librustc/mir/interpret/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index 2082de51d7e..7243e8ddc9b 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -303,7 +303,7 @@ pub enum AllocKind<'tcx> { pub struct AllocMap<'tcx> { /// Lets you know what an AllocId refers to - id_to_type: FxHashMap<AllocId, AllocKind<'tcx>>, + id_to_kind: FxHashMap<AllocId, AllocKind<'tcx>>, /// Used to ensure that statics only get one associated AllocId type_interner: FxHashMap<AllocKind<'tcx>, AllocId>, @@ -316,7 +316,7 @@ pub struct AllocMap<'tcx> { impl<'tcx> AllocMap<'tcx> { pub fn new() -> Self { AllocMap { - id_to_type: Default::default(), + id_to_kind: Default::default(), type_interner: Default::default(), next_id: AllocId(0), } @@ -345,7 +345,7 @@ impl<'tcx> AllocMap<'tcx> { } let id = self.reserve(); debug!("creating alloc_kind {:?} with id {}", alloc_kind, id); - self.id_to_type.insert(id, alloc_kind.clone()); + self.id_to_kind.insert(id, alloc_kind.clone()); self.type_interner.insert(alloc_kind, id); id } @@ -356,7 +356,7 @@ impl<'tcx> AllocMap<'tcx> { /// `main as fn() == main as fn()` is false, while `let x = main as fn(); x == x` is true. pub fn create_fn_alloc(&mut self, instance: Instance<'tcx>) -> AllocId { let id = self.reserve(); - self.id_to_type.insert(id, AllocKind::Function(instance)); + self.id_to_kind.insert(id, AllocKind::Function(instance)); id } @@ -366,7 +366,7 @@ impl<'tcx> AllocMap<'tcx> { /// This function exists to allow const eval to detect the difference between evaluation- /// local dangling pointers and allocations in constants/statics. pub fn get(&self, id: AllocId) -> Option<AllocKind<'tcx>> { - self.id_to_type.get(&id).cloned() + self.id_to_kind.get(&id).cloned() } /// Panics if the `AllocId` does not refer to an `Allocation` @@ -397,7 +397,7 @@ impl<'tcx> AllocMap<'tcx> { /// 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) { - if let Some(old) = self.id_to_type.insert(id, AllocKind::Memory(mem)) { + 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); } } @@ -405,7 +405,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) { - self.id_to_type.insert_same(id, AllocKind::Memory(mem)); + self.id_to_kind.insert_same(id, AllocKind::Memory(mem)); } } |
