]> git.lizzy.rs Git - rust.git/commitdiff
Extend comment in `UsedLocals::visit_lhs`
authorTomasz Miąsko <tomasz.miasko@gmail.com>
Sat, 20 Mar 2021 00:00:00 +0000 (00:00 +0000)
committerTomasz Miąsko <tomasz.miasko@gmail.com>
Sat, 20 Mar 2021 00:00:00 +0000 (00:00 +0000)
compiler/rustc_mir/src/transform/simplify.rs

index d2314a9ba158a18f9a503321b494e86c63c3112a..3b074f9132fd95dfab58a7076b2abced7c7bcd74 100644 (file)
@@ -422,7 +422,9 @@ fn visit_lhs(&mut self, place: &Place<'tcx>, location: Location) {
             // 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),