Skip to content

Commit 43cadc9

Browse files
committed
Extend comment in UsedLocals::visit_lhs
1 parent 41b315a commit 43cadc9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_mir/src/transform/simplify.rs

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

0 commit comments

Comments
 (0)