Skip to content

Commit 69f6a19

Browse files
authored
Rollup merge of #83327 - tmiasko:visit-lhs, r=davidtwco
Extend comment in `UsedLocals::visit_lhs`
2 parents eec77d9 + 43cadc9 commit 69f6a19

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)