diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-03-20 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2021-03-20 00:00:00 +0000 |
| commit | 43cadc99b7de231ad0ca36d397a6bb1e4d590103 (patch) | |
| tree | b504ec4c64dde8cf0c556b50aa79bbe3f32e80b3 | |
| parent | 41b315a470d583f6446599984ff9ad3bd61012b2 (diff) | |
| download | rust-43cadc99b7de231ad0ca36d397a6bb1e4d590103.tar.gz rust-43cadc99b7de231ad0ca36d397a6bb1e4d590103.zip | |
Extend comment in `UsedLocals::visit_lhs`
| -rw-r--r-- | compiler/rustc_mir/src/transform/simplify.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/transform/simplify.rs b/compiler/rustc_mir/src/transform/simplify.rs index d2314a9ba15..3b074f9132f 100644 --- a/compiler/rustc_mir/src/transform/simplify.rs +++ b/compiler/rustc_mir/src/transform/simplify.rs @@ -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), |
