Rollup merge of #83327 - tmiasko:visit-lhs, r=davidtwco

Extend comment in `UsedLocals::visit_lhs`
This commit is contained in:
Dylan DPC 2021-03-21 02:01:40 +01:00 committed by GitHub
commit 69f6a195da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -422,7 +422,9 @@ impl UsedLocals<'tcx> {
// A use, not a definition.
self.visit_place(place, PlaceContext::MutatingUse(MutatingUseContext::Store), location);
} else {
// A definition. Although, it still might use other locals for indexing.
// A definition. The base local itself is not visited, so this occurrence is not counted
// toward its use count. There might be other locals still, used in an indexing
// projection.
self.super_projection(
place.as_ref(),
PlaceContext::MutatingUse(MutatingUseContext::Projection),