about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-11-28 18:02:12 +0100
committerRalf Jung <post@ralfj.de>2020-11-28 18:02:12 +0100
commit0bb82c4a059934f78a67ff0ff9e4517171ad1dab (patch)
tree7e8691c6468251929878fcdff04cbdb4e3776d0c
parent571da2c62d0ac6360b78796e764ad5fe0753f553 (diff)
downloadrust-0bb82c4a059934f78a67ff0ff9e4517171ad1dab.tar.gz
rust-0bb82c4a059934f78a67ff0ff9e4517171ad1dab.zip
expand iter_projections comment
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index 2bd30001a91..62e5a1e18f8 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -1744,6 +1744,10 @@ impl<'tcx> Place<'tcx> {
 
     /// Iterate over the projections in evaluation order, i.e., the first element is the base with
     /// its projection and then subsequently more projections are added.
+    /// As a concrete example, given the place a.b.c, this would yield:
+    /// - (a, .b)
+    /// - (a.b, .c)
+    /// Given a place without projections, the iterator is empty.
     pub fn iter_projections(
         self,
     ) -> impl Iterator<Item = (PlaceRef<'tcx>, PlaceElem<'tcx>)> + DoubleEndedIterator {