Skip to content

Commit

Permalink
Rollup merge of #83327 - tmiasko:visit-lhs, r=davidtwco
Browse files Browse the repository at this point in the history
Extend comment in `UsedLocals::visit_lhs`
  • Loading branch information
Dylan-DPC committed Mar 21, 2021
2 parents eec77d9 + 43cadc9 commit 69f6a19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_mir/src/transform/simplify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 69f6a19

Please sign in to comment.