Skip to content

Commit

Permalink
Extend comment in UsedLocals::visit_lhs
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiasko committed Mar 20, 2021
1 parent 41b315a commit 43cadc9
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 43cadc9

Please sign in to comment.