@@ -166,6 +166,15 @@ macro_rules! make_mir_visitor {
166
166
self . super_projection( base, projection, context, location) ;
167
167
}
168
168
169
+ fn visit_projection_elem( & mut self ,
170
+ base: & $( $mutability) ? PlaceBase <' tcx>,
171
+ proj_base: & $( $mutability) ? [ PlaceElem <' tcx>] ,
172
+ elem: & $( $mutability) ? PlaceElem <' tcx>,
173
+ context: PlaceContext ,
174
+ location: Location ) {
175
+ self . super_projection_elem( base, proj_base, elem, context, location) ;
176
+ }
177
+
169
178
fn visit_constant( & mut self ,
170
179
constant: & $( $mutability) ? Constant <' tcx>,
171
180
location: Location ) {
@@ -727,25 +736,33 @@ macro_rules! make_mir_visitor {
727
736
location: Location ) {
728
737
if let [ proj_base @ .., elem] = projection {
729
738
self . visit_projection( base, proj_base, context, location) ;
739
+ self . visit_projection_elem( base, proj_base, elem, context, location) ;
740
+ }
741
+ }
730
742
731
- match elem {
732
- ProjectionElem :: Field ( _field, ty) => {
733
- self . visit_ty( ty, TyContext :: Location ( location) ) ;
734
- }
735
- ProjectionElem :: Index ( local) => {
736
- self . visit_local(
737
- local,
738
- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) ,
739
- location
740
- ) ;
741
- }
742
- ProjectionElem :: Deref |
743
- ProjectionElem :: Subslice { from: _, to: _ } |
744
- ProjectionElem :: ConstantIndex { offset: _,
745
- min_length: _,
746
- from_end: _ } |
747
- ProjectionElem :: Downcast ( _, _) => {
748
- }
743
+ fn super_projection_elem( & mut self ,
744
+ _base: & $( $mutability) ? PlaceBase <' tcx>,
745
+ _proj_base: & $( $mutability) ? [ PlaceElem <' tcx>] ,
746
+ elem: & $( $mutability) ? PlaceElem <' tcx>,
747
+ _context: PlaceContext ,
748
+ location: Location ) {
749
+ match elem {
750
+ ProjectionElem :: Field ( _field, ty) => {
751
+ self . visit_ty( ty, TyContext :: Location ( location) ) ;
752
+ }
753
+ ProjectionElem :: Index ( local) => {
754
+ self . visit_local(
755
+ local,
756
+ PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) ,
757
+ location
758
+ ) ;
759
+ }
760
+ ProjectionElem :: Deref |
761
+ ProjectionElem :: Subslice { from: _, to: _ } |
762
+ ProjectionElem :: ConstantIndex { offset: _,
763
+ min_length: _,
764
+ from_end: _ } |
765
+ ProjectionElem :: Downcast ( _, _) => {
749
766
}
750
767
}
751
768
}
0 commit comments