@@ -194,27 +194,17 @@ pub trait MirVisitor {
194
194
self . visit_place ( place, PlaceContext :: MUTATING , location) ;
195
195
self . visit_rvalue ( rvalue, location) ;
196
196
}
197
- StatementKind :: FakeRead ( _, place) => {
197
+ StatementKind :: FakeRead ( _, place) | StatementKind :: PlaceMention ( place ) => {
198
198
self . visit_place ( place, PlaceContext :: NON_MUTATING , location) ;
199
199
}
200
- StatementKind :: SetDiscriminant { place, .. } => {
200
+ StatementKind :: SetDiscriminant { place, .. }
201
+ | StatementKind :: Deinit ( place)
202
+ | StatementKind :: Retag ( _, place) => {
201
203
self . visit_place ( place, PlaceContext :: MUTATING , location) ;
202
204
}
203
- StatementKind :: Deinit ( place) => {
204
- self . visit_place ( place, PlaceContext :: MUTATING , location) ;
205
- }
206
- StatementKind :: StorageLive ( local) => {
207
- self . visit_local ( local, PlaceContext :: NON_USE , location) ;
208
- }
209
- StatementKind :: StorageDead ( local) => {
205
+ StatementKind :: StorageLive ( local) | StatementKind :: StorageDead ( local) => {
210
206
self . visit_local ( local, PlaceContext :: NON_USE , location) ;
211
207
}
212
- StatementKind :: Retag ( _, place) => {
213
- self . visit_place ( place, PlaceContext :: MUTATING , location) ;
214
- }
215
- StatementKind :: PlaceMention ( place) => {
216
- self . visit_place ( place, PlaceContext :: NON_MUTATING , location) ;
217
- }
218
208
StatementKind :: AscribeUserType { place, projections, variance : _ } => {
219
209
self . visit_place ( place, PlaceContext :: NON_USE , location) ;
220
210
self . visit_user_type_projection ( projections) ;
@@ -234,8 +224,7 @@ pub trait MirVisitor {
234
224
self . visit_operand ( count, location) ;
235
225
}
236
226
} ,
237
- StatementKind :: ConstEvalCounter => { }
238
- StatementKind :: Nop => { }
227
+ StatementKind :: ConstEvalCounter | StatementKind :: Nop => { }
239
228
}
240
229
}
241
230
@@ -304,14 +293,15 @@ pub trait MirVisitor {
304
293
location : Location ,
305
294
) {
306
295
match elem {
307
- ProjectionElem :: Deref => { }
296
+ ProjectionElem :: Downcast ( _idx) => { }
297
+ ProjectionElem :: ConstantIndex { offset : _, min_length : _, from_end : _ }
298
+ | ProjectionElem :: Deref
299
+ | ProjectionElem :: Subslice { from : _, to : _, from_end : _ } => { }
308
300
ProjectionElem :: Field ( _idx, ty) => self . visit_ty ( ty, location) ,
309
301
ProjectionElem :: Index ( local) => self . visit_local ( local, ptx, location) ,
310
- ProjectionElem :: ConstantIndex { offset : _, min_length : _, from_end : _ } => { }
311
- ProjectionElem :: Subslice { from : _, to : _, from_end : _ } => { }
312
- ProjectionElem :: Downcast ( _idx) => { }
313
- ProjectionElem :: OpaqueCast ( ty) => self . visit_ty ( ty, location) ,
314
- ProjectionElem :: Subtype ( ty) => self . visit_ty ( ty, location) ,
302
+ ProjectionElem :: OpaqueCast ( ty) | ProjectionElem :: Subtype ( ty) => {
303
+ self . visit_ty ( ty, location)
304
+ }
315
305
}
316
306
}
317
307
0 commit comments