From 7c3d2f729de8e3597d91d0b85619afde814afcea Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 17 Mar 2017 15:36:04 -0400 Subject: [PATCH] make a hit-list of functions I'd like to remove --- src/librustc/dep_graph/dep_tracking_map.rs | 6 +++--- src/librustc/ty/mod.rs | 6 +++--- src/librustc_metadata/decoder.rs | 4 ++-- src/librustc_typeck/coherence/builtin.rs | 2 +- src/librustc_typeck/coherence/inherent.rs | 2 +- src/librustc_typeck/variance/solve.rs | 2 +- src/librustc_typeck/variance/terms.rs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/librustc/dep_graph/dep_tracking_map.rs b/src/librustc/dep_graph/dep_tracking_map.rs index f7a6dee8307d3..a292d42887794 100644 --- a/src/librustc/dep_graph/dep_tracking_map.rs +++ b/src/librustc/dep_graph/dep_tracking_map.rs @@ -88,7 +88,7 @@ impl DepTrackingMap { result } - pub fn insert(&mut self, k: M::Key, v: M::Value) { + pub fn __insert__(&mut self, k: M::Key, v: M::Value) { self.write(&k); // If we ever read a `None` value for this key, we do not want @@ -103,7 +103,7 @@ impl DepTrackingMap { assert!(old_value.is_none(), "inserted value twice"); } - pub fn entry(&mut self, k: M::Key) -> Entry { + pub fn __entry__(&mut self, k: M::Key) -> Entry { self.write(&k); self.map.entry(k) } @@ -129,7 +129,7 @@ impl DepTrackingMap { /// NOTE: Caution is required when using this method. You should /// be sure that nobody is **reading from the vector** while you /// are writing to it. Eventually, it'd be nice to remove this. - pub fn push(&mut self, k: M::Key, elem: E) + pub fn __push__(&mut self, k: M::Key, elem: E) where M: DepTrackingMapConfig> { self.write(&k); diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 39f20b3860843..64071f911d8bc 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2062,7 +2062,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { impl_trait_ref.is_some(), impl_item_ref); self.maps.associated_item.borrow_mut() - .insert(assoc_item.def_id, assoc_item); + .__insert__(assoc_item.def_id, assoc_item); } } @@ -2071,7 +2071,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { let assoc_item = self.associated_item_from_trait_item_ref(parent_def_id, trait_item_ref); self.maps.associated_item.borrow_mut() - .insert(assoc_item.def_id, assoc_item); + .__insert__(assoc_item.def_id, assoc_item); } } @@ -2367,7 +2367,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { let inherent_impls = self.sess.cstore.inherent_implementations_for_type(type_id); - self.maps.inherent_impls.borrow_mut().insert(type_id, inherent_impls); + self.maps.inherent_impls.borrow_mut().__insert__(type_id, inherent_impls); self.populated_external_types.borrow_mut().insert(type_id); } diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index b4b9966cbe47b..df44b7f69a38b 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -527,7 +527,7 @@ impl<'a, 'tcx> CrateMetadata { if let ty::VariantDiscr::Explicit(def_id) = data.discr { let result = data.evaluated_discr.map_or(Err(()), Ok); - tcx.maps.monomorphic_const_eval.borrow_mut().insert(def_id, result); + tcx.maps.monomorphic_const_eval.borrow_mut().__insert__(def_id, result); } (ty::VariantDef { @@ -584,7 +584,7 @@ impl<'a, 'tcx> CrateMetadata { let adt = tcx.alloc_adt_def(did, kind, variants, repr); if let Some(ctor_index) = ctor_index { // Make adt definition available through constructor id as well. - tcx.maps.adt_def.borrow_mut().insert(self.local_def_id(ctor_index), adt); + tcx.maps.adt_def.borrow_mut().__insert__(self.local_def_id(ctor_index), adt); } adt diff --git a/src/librustc_typeck/coherence/builtin.rs b/src/librustc_typeck/coherence/builtin.rs index 3cdf9fc93ae60..f3ee934f09552 100644 --- a/src/librustc_typeck/coherence/builtin.rs +++ b/src/librustc_typeck/coherence/builtin.rs @@ -332,7 +332,7 @@ fn visit_implementation_of_coerce_unsized<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, infcx.resolve_regions_and_report_errors(&free_regions, impl_node_id); if let Some(kind) = kind { - tcx.maps.custom_coerce_unsized_kind.borrow_mut().insert(impl_did, kind); + tcx.maps.custom_coerce_unsized_kind.borrow_mut().__insert__(impl_did, kind); } }); } diff --git a/src/librustc_typeck/coherence/inherent.rs b/src/librustc_typeck/coherence/inherent.rs index e3b4ba9eb1b9e..816d85a113439 100644 --- a/src/librustc_typeck/coherence/inherent.rs +++ b/src/librustc_typeck/coherence/inherent.rs @@ -227,7 +227,7 @@ impl<'a, 'tcx> InherentCollect<'a, 'tcx> { // because we are doing this as a pre-pass before anyone // actually reads from `inherent_impls` -- and we know this is // true beacuse we hold the refcell lock. - self.tcx.maps.inherent_impls.borrow_mut().push(def_id, impl_def_id); + self.tcx.maps.inherent_impls.borrow_mut().__push__(def_id, impl_def_id); } else { struct_span_err!(self.tcx.sess, item.span, diff --git a/src/librustc_typeck/variance/solve.rs b/src/librustc_typeck/variance/solve.rs index 6628c7c521fd1..e62494dbe5f04 100644 --- a/src/librustc_typeck/variance/solve.rs +++ b/src/librustc_typeck/variance/solve.rs @@ -139,7 +139,7 @@ impl<'a, 'tcx> SolveContext<'a, 'tcx> { tcx.maps.variances .borrow_mut() - .insert(item_def_id, Rc::new(item_variances)); + .__insert__(item_def_id, Rc::new(item_variances)); } } diff --git a/src/librustc_typeck/variance/terms.rs b/src/librustc_typeck/variance/terms.rs index 36352f50e4406..ffc1f47bb4ed9 100644 --- a/src/librustc_typeck/variance/terms.rs +++ b/src/librustc_typeck/variance/terms.rs @@ -180,7 +180,7 @@ impl<'a, 'tcx> TermsContext<'a, 'tcx> { let item_def_id = self.tcx.hir.local_def_id(item_id); self.tcx.maps.variances .borrow_mut() - .insert(item_def_id, self.empty_variances.clone()); + .__insert__(item_def_id, self.empty_variances.clone()); } }