diff --git a/src/librustc_mir/borrow_check/nll/region_infer/values.rs b/src/librustc_mir/borrow_check/nll/region_infer/values.rs index 8092b773eae..d3d84568804 100644 --- a/src/librustc_mir/borrow_check/nll/region_infer/values.rs +++ b/src/librustc_mir/borrow_check/nll/region_infer/values.rs @@ -15,7 +15,6 @@ use rustc_data_structures::indexed_vec::Idx; use rustc_data_structures::indexed_vec::IndexVec; use std::fmt::Debug; use std::rc::Rc; -use std::ops::Range; /// Maps between the various kinds of elements of a region value to /// the internal indices that w use. @@ -65,11 +64,6 @@ impl RegionValueElements { PointIndex::new(start_index + statement_index) } - /// Range coverting all point indices. - fn all_points(&self) -> Range { - PointIndex::new(0)..PointIndex::new(self.num_points) - } - /// Converts a particular `RegionElementIndex` to a location, if /// that is what it represents. Returns `None` otherwise. crate fn to_location(&self, i: PointIndex) -> Location { @@ -159,10 +153,7 @@ impl RegionValues { /// Adds all the control-flow points to the values for `r`. crate fn add_all_points(&mut self, r: N) { - // FIXME OMG so inefficient. We'll fix later. - for p in self.elements.all_points() { - self.points.add(r, p); - } + self.points.add_all(r); } /// Add all elements in `r_from` to `r_to` (because e.g. `r_to: