diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2018-04-07 08:01:21 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2018-04-15 07:06:30 -0400 |
| commit | df233f0f2c8d5e07e6c13873c5a9f7a2abda9707 (patch) | |
| tree | 8b9da7cf487e7ba37b6047f1ecc1b9671bb0550e /src/librustc_mir/dataflow/impls | |
| parent | d4005a2bc9adeb5a19b04bd4354e22e9e75a7072 (diff) | |
| download | rust-df233f0f2c8d5e07e6c13873c5a9f7a2abda9707.tar.gz rust-df233f0f2c8d5e07e6c13873c5a9f7a2abda9707.zip | |
stop using `borrows` for anything but iterating over live data
Diffstat (limited to 'src/librustc_mir/dataflow/impls')
| -rw-r--r-- | src/librustc_mir/dataflow/impls/borrows.rs | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/src/librustc_mir/dataflow/impls/borrows.rs b/src/librustc_mir/dataflow/impls/borrows.rs index b1fa7eeb3a5..55c38dc89f6 100644 --- a/src/librustc_mir/dataflow/impls/borrows.rs +++ b/src/librustc_mir/dataflow/impls/borrows.rs @@ -16,7 +16,7 @@ use rustc::hir; use rustc::hir::def_id::DefId; use rustc::middle::region; use rustc::mir::{self, Location, Place, Mir}; -use rustc::ty::{Region, TyCtxt}; +use rustc::ty::TyCtxt; use rustc::ty::RegionKind; use rustc::ty::RegionKind::ReScope; @@ -30,8 +30,6 @@ pub use dataflow::indexes::BorrowIndex; use borrow_check::nll::region_infer::RegionInferenceContext; use borrow_check::nll::ToRegionVid; -use syntax_pos::Span; - use std::rc::Rc; /// `Borrows` stores the data used in the analyses that track the flow @@ -77,22 +75,6 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> { } } - /// Returns the span for the "end point" given region. This will - /// return `None` if NLL is enabled, since that concept has no - /// meaning there. Otherwise, return region span if it exists and - /// span for end of the function if it doesn't exist. - pub(crate) fn opt_region_end_span(&self, region: &Region) -> Option<Span> { - match self.nonlexical_regioncx { - Some(_) => None, - None => { - match self.borrow_set.region_span_map.get(region) { - Some(span) => Some(self.tcx.sess.codemap().end_point(*span)), - None => Some(self.tcx.sess.codemap().end_point(self.mir.span)) - } - } - } - } - crate fn borrows(&self) -> &IndexVec<BorrowIndex, BorrowData<'tcx>> { &self.borrow_set.borrows } pub fn scope_tree(&self) -> &Lrc<region::ScopeTree> { &self.scope_tree } @@ -136,13 +118,6 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> { sets.kill_all(borrow_indexes); } } - - crate fn activations_at_location(&self, location: Location) -> &[BorrowIndex] { - self.borrow_set.activation_map - .get(&location) - .map(|activations| &activations[..]) - .unwrap_or(&[]) - } } impl<'a, 'gcx, 'tcx> BitDenotation for Borrows<'a, 'gcx, 'tcx> { |
