From 26c406945bdfbf21a14c8e1a0bf34c7e2db4cd09 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Wed, 17 Oct 2018 15:27:07 +0200 Subject: [PATCH] Remove `PlaceContext` from API of `mir::Visitor::visit_projection_elem`. It is unused, and would not make sense to maintain in the commits later in this PR. --- src/librustc/mir/visit.rs | 6 ++---- src/librustc_passes/mir_stats.rs | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 76c76404d2fd..1a879ce5f7b8 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -175,9 +175,8 @@ macro_rules! make_mir_visitor { fn visit_projection_elem(&mut self, place: & $($mutability)* PlaceElem<'tcx>, - context: PlaceContext<'tcx>, location: Location) { - self.super_projection_elem(place, context, location); + self.super_projection_elem(place, location); } fn visit_branch(&mut self, @@ -692,12 +691,11 @@ macro_rules! make_mir_visitor { PlaceContext::Projection(Mutability::Not) }; self.visit_place(base, context, location); - self.visit_projection_elem(elem, context, location); + self.visit_projection_elem(elem, location); } fn super_projection_elem(&mut self, proj: & $($mutability)* PlaceElem<'tcx>, - _context: PlaceContext<'tcx>, location: Location) { match *proj { ProjectionElem::Deref => { diff --git a/src/librustc_passes/mir_stats.rs b/src/librustc_passes/mir_stats.rs index 0b9b20d3c453..06c8545aacfd 100644 --- a/src/librustc_passes/mir_stats.rs +++ b/src/librustc_passes/mir_stats.rs @@ -211,7 +211,6 @@ impl<'a, 'tcx> mir_visit::Visitor<'tcx> for StatCollector<'a, 'tcx> { fn visit_projection_elem(&mut self, place: &PlaceElem<'tcx>, - context: mir_visit::PlaceContext<'tcx>, location: Location) { self.record("PlaceElem", place); self.record(match *place { @@ -222,7 +221,7 @@ impl<'a, 'tcx> mir_visit::Visitor<'tcx> for StatCollector<'a, 'tcx> { ProjectionElem::ConstantIndex { .. } => "PlaceElem::ConstantIndex", ProjectionElem::Downcast(..) => "PlaceElem::Downcast", }, place); - self.super_projection_elem(place, context, location); + self.super_projection_elem(place, location); } fn visit_constant(&mut self, constant: &Constant<'tcx>, location: Location) {