Skip to content
Permalink
Browse files

Deduplicate some code

  • Loading branch information...
oli-obk committed Jun 8, 2019
1 parent bafda92 commit e5375b293ed4c92b5f9d91bde3d44f1deaaeaea7
Showing with 2 additions and 15 deletions.
  1. +2 −15 src/librustc/mir/visit.rs
@@ -710,23 +710,10 @@ macro_rules! make_mir_visitor {
proj: & $($mutability)? Projection<'tcx>,
context: PlaceContext,
location: Location) {
// this is duplicated with `super_place` in preparation for changing `Place` to be
// this is calling `super_place` in preparation for changing `Place` to be
// a struct with a base and a slice of projections. `visit_place` should only ever
// be called for the base place now.
match & $($mutability)? proj.base {
Place::Base(place_base) => {
self.visit_place_base(place_base, context, location);
}
Place::Projection(proj) => {
let context = if context.is_mutating_use() {
PlaceContext::MutatingUse(MutatingUseContext::Projection)
} else {
PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection)
};

self.visit_projection(proj, context, location);
}
}
self.super_place(& $($mutability)? proj.base, context, location);
match & $($mutability)? proj.elem {
ProjectionElem::Deref => {
}

0 comments on commit e5375b2

Please sign in to comment.
You can’t perform that action at this time.