Skip to content

Commit e5375b2

Browse files
committedJun 8, 2019
Deduplicate some code
1 parent bafda92 commit e5375b2

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed
 

‎src/librustc/mir/visit.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -710,23 +710,10 @@ macro_rules! make_mir_visitor {
710710
proj: & $($mutability)? Projection<'tcx>,
711711
context: PlaceContext,
712712
location: Location) {
713-
// this is duplicated with `super_place` in preparation for changing `Place` to be
713+
// this is calling `super_place` in preparation for changing `Place` to be
714714
// a struct with a base and a slice of projections. `visit_place` should only ever
715715
// be called for the base place now.
716-
match & $($mutability)? proj.base {
717-
Place::Base(place_base) => {
718-
self.visit_place_base(place_base, context, location);
719-
}
720-
Place::Projection(proj) => {
721-
let context = if context.is_mutating_use() {
722-
PlaceContext::MutatingUse(MutatingUseContext::Projection)
723-
} else {
724-
PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection)
725-
};
726-
727-
self.visit_projection(proj, context, location);
728-
}
729-
}
716+
self.super_place(& $($mutability)? proj.base, context, location);
730717
match & $($mutability)? proj.elem {
731718
ProjectionElem::Deref => {
732719
}

0 commit comments

Comments
 (0)
Please sign in to comment.