diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-06-08 23:23:10 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-06-08 23:26:17 +0200 |
| commit | e5375b293ed4c92b5f9d91bde3d44f1deaaeaea7 (patch) | |
| tree | 6a7955a4c39e1d7cc6861571ee6c85554fc3982f | |
| parent | bafda927c3bf69e9e7b9ca0f8d8d930bb543909d (diff) | |
| download | rust-e5375b293ed4c92b5f9d91bde3d44f1deaaeaea7.tar.gz rust-e5375b293ed4c92b5f9d91bde3d44f1deaaeaea7.zip | |
Deduplicate some code
| -rw-r--r-- | src/librustc/mir/visit.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index ce015631cd1..a5793a3ca1f 100644 --- a/src/librustc/mir/visit.rs +++ b/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 => { } |
